First click slow

I created a simple application with wpf and noticed a strange behavior: The application has two buttons, with unrelated and very simple behavior. Whenever I launch it, the first click of any of the buttons takes two to three seconds. Only the first click is slow. Subsequent clicks are almost instantaneous, as expected for their simple behavior. I was looking for google and SO, but no one seems to have encountered the same problem.

Application Details:

NorthWind db on SQL Server 2008;

Linq to SQL auto-generated classes;

Customers Table as DataGrid;

Button 1 OnClick Event: Context.SubmitChanges() ;

Button 2 OnClick The event alternates the logical DependencyProperty in the MainWindow class.

As you can see, the setup is very simple. If every button click was slow, I would attribute them to WPF performance issues. It is strange that whenever I launch it, only the first click responds slowly, and the others are normal.

+7
c # wpf
source share
1 answer

To get this question from an unanswered list, here are my conclusions: this is a known issue with IntelliTrace gesture capture. Disabling gesture capture (Tools> → Options-> IntelliTrace-> IntelliTrace Events) completely fixes the problem. More details can be found in this answer.

+9
source share

All Articles