Using the original code, the wrong window might be addressed.
I can’t count the number of times someone has asked me about running a time consuming task on a separate thread, but at the same time show a progress dialog with up-to-the-second percentage updates being displayed to the user.
Multithreading can be confusing at first, but if you just take it one step at a time, it really isn’t all that bad.
My first little tutorial will be on making a simple text editor (you can never have too many text editors, right? Once we have walked through this tutorial you should be able to have produced something like the below screen shot.
This is a text editor with a tool bar row in the top, a text field in the middle and a status bar at the bottom. In the Windows Forms era Visual Studio always generated a magic designer file - and of you edited code in it you typically broke the application.
This provides the Splash Screen View Model class with the change notification necessary to update the UI.
In this article, we will see how to make use of the Progress Bar control provided in WPF.
Note that line #19 places a call to Notify Property Changed whenever the property value is set. Again, this is quite simple – just a two-row, one column grid housing an image and a Text Block.
Lines #12-21 define the public Spash Screen Text property and its private backing store.
The code in the Do Work event handler is executed on a separate thread.
Providing Parameters to the Process Your background process may required one or more parameters, such as the address of a file to download.