问题
I have my custom message box class, which inherits Window class and has a method to automatically close itself after the designated time collapsed. I'm in trouble with the ShowDialog method of this class when I'm in a case described below.
There emerges a ShowDialog of a custom message box, which is set to automatically close in several seconds.
Before the first one is closed, there emerges a ShowDialog of another custom message box, which is not set to automatically close.
- When the first one is closed, the ShowDialog function of the second one becomes invalid, ie. the MainWindow becomes selectable.
This problem happens no matter whether each custom message box emerges from a single thread or not.
How can I avoid this? If it is necessary to override ShowDialog, how is it possible?
来源:https://stackoverflow.com/questions/26668524/c-sharp-a-trouble-regarding-window-showdialog