I like to make efficient applications and often look at concurrency and multithreading to improve application responsiveness, etc., but lately, my attempts always seem to be blocked by single-threaded WPFs. No matter how efficient and parallel my code is, WPF seems to constantly stop my user interface and makes my application incredibly unresponsive - sometimes waiting for a window to render can take precious seconds (where even the mouse cursor will not move). I find this frustrating as it seems that I can do nothing to speed up the process.
So my question is: is there anything I can do to improve responsiveness in my WPF application? My windows tend to be quite complex in style and composition, and I'm already using StackPanels virtualization.
To illustrate my problem: I have a text box that acts like a search box, and I want the results to be displayed on the go as user types (each result is encapsulated in UserControl and displayed in ItemsControl). I use background threads to do a search. The problem is that when WPF displays the search results, which completely closes the user interface to print for a few seconds at a time, while WPF is selected, making all the "results as you type" not very viable.
Is there any way to avoid a user interface thread bypass when rendering WPF?
source
share