I want to display a modal dialog with a progress bar while doing some work on the main UI Thread. Without using any multi-threading technique my UI would for sure be in a hanging state.
How do I achieve this while running the computationally intensive long operation on the main thread (as it involves UI elements and I shudder to touch this legacy code), while displaying the status of the computation on the wait window (which shall run on a different thread)
I need to run a progress dialog window on a different thread while keeping the main thread occupied to compute the long bound operation involving main UI form elements.
Thanks for some pointers
BackgroundWorker- MickyDasyncandawaittogether withTask.Runwhich will make this easier. As others have noted you need to do the work on a background thread to keep the UI from frosting over, but you don't need to resort to background worker. - Aluan HaddadSystem.Progress<T>type. - Aluan Haddad