I'm using PushFrame to ensure that my window finishes drawing before executing additional code. My application has some time sensitive functions that require the windows have been updated before I continues executing code.
So I'm using the sample from msdn: http://msdn.microsoft.com/en-us/library/vstudio/system.windows.threading.dispatcher.pushframe(v=vs.110).aspx
Which works great, except, if a user is dragging my window when this code executes the window hangs and you can only get it back with a ctrl-alt-del.
Any ideas?
Dispatcher.BeginInvoke()
with the properDispatcherPriority
?DispatcherPriority.ApplicationIdle
guarantees that your code will be called after everything else has completed. BTW the word "painted" sounds too winforms. What are you actually trying to do?TaskScheduler.FromCurrentSynchronizationContext