Then you must check for the value of the Cancellation Pending property in the Do Work event handler, and if it is true, set the Cancel property of the Do Work Event Args parameter to true.
Both methods allows you to call a method safely on the UI thread.
The Begin Invoke method allows you to call a method asynchronously, and the Invoke method allows you to call a method synchronously.
You can get a reference to the Dispacther object for a UI element from its Dispatcher property.
Dispatcher provides two main methods that you will use; Invoke and Begin Invoke.
This method raises the Progress Changed event and allows you to pass a parameter that indicated the percentage of progress that has been completed.