I've created a simple application with wpf, and noticed a strange behavior: the Application has two buttons, with unrelated and very simple behaviors. Whenever I launch it, the first click of any of the buttons takes two to three seconds to complete. Only the first click is slow. Subsequent clicks are almost immediate, as expected for their simple behaviour. I've searched google and SO, but nobody seems to be experiencing the same problem.
the details of the application are:
NorthWind db on SQL server 2008;
Linq to SQL auto generated classes;
Customers
Table as a DataGrid;
Button 1 OnClick
Event: Context.SubmitChanges()
;
Button 2 Onclick
Event alternates a boolean DependencyProperty on the MainWindow
class.
As you can see, the setup is very simple. If every single click of the buttons was slow, I would have attributed them to WPF performance issues. What is strange is that whenever I launch it, only the first click responds slowly, and others are normal.