Winforms WPF Performance

My project requires a background thread to initiate the creation of a WPF control hosted in Winform. Creating the specified control must be done in the foreground thread, which is very expensive and causes the user interface to hang for 1 to 2.5 seconds (depending on whether this is the first time the control is created).

Are there any pre-creation optimizations that can be made from the background thread to reduce the amount of work performed by the user interface thread?

+3
source share
1 answer

Suppose you are using an ElementHost control to host a Wpf control in a winforms application? I think that the overhead you see is really necessary because the device context on which the wpf elements are rendered is tied to the winforms application and does not live in a regular wpf application. My experience is that when you open a form with ElementHost on it, the second time is much faster, but, of course, it depends on what you do when it opens.

+1
source

All Articles