In WPF, the UI is managed by a single thread, called a UI thread, which that creates an instance of a window and processes the UI messages for that window. This is known as message pumping.
When the UI thread is performing a lot of operations, it enters in to a wait state and stops processing further UI messages. This causes the application to enter Not Responding mode, which is commonly known as UI freezing.
To resolve this issue, you need to offload that long running operation into another thread. This keeps the UI thread free and allows it to perform the UI updates and stay responsive.
In this recipe, we will learn how to offload a long running process into a separate thread in a thread pool and perform the UI updates once it completes the execution.