I have a window which runs from a thread, let's call it MainThread, and a background thread which performs other non-graphical tasks.
Sometimes the background thread will call the MessageBox.Show(...)
method (which is modal and stops the background thread). Before this call, I would like to suspend the MainThread and resume it after so that my MainWindow's controls are disabled while the messageBox
is shown.
So my questions are:
- How do I access the mainThread from the backgroundThread?
- How do I suspend/resume it (Considering Thread.suspend is depricated)?