What is equivalent to Application.DoEvents() in WPF applications
From MSDN, it seems that Applicat开发者_如何转开发ion.DoEvents() is available in Windows.Forms. What would be the equivalent thing in WPF.
While i agree with the Skeet you can find a WPF method like that on the documentation page of the DispatcherFrame
You shouldn't be using it even in Windows Forms. Don't perform long-running tasks on the UI thread - use a background thread and use the Dispatcher
to update the UI as required. Any use of Application.DoEvents
is basically a code smell. I don't know whether there is an equivalent in WPF, but you should try to avoid it even if there is.
精彩评论