In the previous recipes, we used thread pool to perform long running operations in a different thread. From there, we had to update the UI by marshalling the code to the UI thread, which required additional work.
To overcome this explicit thread pooling and the marshalling of the UI updation on the UI thread, we can use the System.ComponentModel.BackgroundWorker class. It provides automatic management of long running operations on a background thread.
In this recipe, we will use that BackgroundWorker to do the asynchronous operations without blocking the UI thread.