If I create a class derived from System.Windows.Window and show it with ShowDialog it appears above the main window as expected, and the main window is disabled.
However it is possible to put both windows behind other applications, and then just bring the main window back. This just leaves a single window which appears to have crashed, and can be confusing.
Is it possible to ensure that the dialog window is always displayed if the main window is shown? The MessageBox.Show dialog has no such problems
Update:
A test dialog is defined as
public partial class MyDialog : Window
{
public MyDialog()
{
InitializeComponent();
}
}
and called using
MyDialog d = new MyDialog();
d.ShowDialog();
you have to set the Owner property.