How to make WPF window open faster in VS add-in?

I have a Visual Studio add-in that opens a WPF modal window.

My problem is it takes 4 seconds to display the window the first time, which is clearly a bad service for the client. So I'm wondering if there is a way to optimize this?

Is there any great code to preload the PresentationFramework (or is something slowing down) when the add-in starts, not when it is actually used?

+1


source to share


1 answer


You can check the output window in VS to see if a DLL is actually paused that it hasn't loaded yet. In this case, you can try the following:

When the application starts, load an empty hidden WPF window and close it.



This should "preload" the view environment (if this is actually a problem — sometimes difficult to tell with these cases.) So that when you call the desired window, it's ready to open.

Not the best solution, but users can usually wait 4 seconds.

+1


source







All Articles