I love to make efficient apps and often look to concurrency and multithreading to improve application responsiveness and such, but lately my attempts always seem to be blocked by WPF's single-threadedness. No matter how efficient and parallel my code is, WPF seems to continually stall my UI and make my app look incredibly unresponsive--sometimes waiting for a window to render can take precious seconds (where even the mouse cursor won't move). I find this frustrating as it seems there's nothing I can do to speed things up.
My question, then, is is there anything I can do to improve responsiveness in my WPF app? My windows tend to be rather complex in style and composition, and I am already using virtualizing StackPanels.
To illustrate my problem: I have a text box that acts as a search box, and I want results displayed on the fly as the user types (each result is encapsulated in a UserControl and displayed in an ItemsControl). I am using background threads to perform the search. The problem is, it's when WPF renders the results of the search that completely stalls the UI so that typing is frozen for seconds at a time while WPF churns away, making the whole "results as you type" thing not very viable.
Is there any way I can avoid having the UI thread stall while WPF is rendering?