The standard way of allowing Windows messages to be processed is to call Application.DoEvents method. However, the Application class in WPF does not have a DoEvents method. So, what you need is to find a way of calling this method, or an alternative method! Actually, it is surprisingly easy to do so: Instead of calling
you can call:
This will work as desired!