How to preload WPF runtime engine or how to reduce boot time?

we have an outdated application made in VB6. When we add new windows to this application, we create them using WPF, and we open the COM interface to open it from VB6. The problem is that the first time you open the WPF window, it takes some time, because the system needs to load the WPF runtime.

Is there a way to load the runtime in the background so that the user does not have to wait while opening a window?

Thanks.

+4
source share
1 answer

Some ideas:

  • Create hidden WPF windows when starting the VB6 application, so WPF will load while the user does something else in the application.
  • If it does not work with a hidden window, you can still create a WPF window with positin as a new point (10000, 10000), and choose not to display this window on the taskbar, so this hidden WPF window will force .NET to load WPF .

So, you can create an invisible WPF window in the background when the application starts, and the user does not have to wait later.

+1
source

Source: https://habr.com/ru/post/1385900/


All Articles