If I create a class derived from System.Windows.Window and show it using ShowDialog, it will appear above the main window, as expected, and the main window is disabled. However, you can place both windows behind other applications, and then simply return the main window. It just leaves one window that seems to have broken and can be confusing.
Is it possible to guarantee that a dialog is always displayed if the main window is displayed? The MessageBox.Show dialog box does not have such problems.
Update:
The test dialog is defined as
public partial class MyDialog : Window { public MyDialog() { InitializeComponent(); } }
and called using
MyDialog d = new MyDialog(); d.ShowDialog();
c # wpf modal-dialog
David sykes
source share