WPF Modal Dialog - can't be first window in the app?

Aug 22, 2008 at 9:05 PM
Hi All,

Check out these simple situations in Application_Startup event handler (do it one at a time before any other code):

//1. Works:
(new OpenFileDialog()).ShowDialog();

//2. Works:
(new OpenFileDialog()).ShowDialog();
(new Window()).ShowDialog();

//3. Doesn't Work:
(new Window()).ShowDialog();
(new OpenFileDialog()).ShowDialog();

//4. Works:
(new Window()).Show();
(new OpenFileDialog()).ShowDialog();

//5. Second Window won't show, modal or modeless:
(new Window()).ShowDialog();
(new Window()).ShowDialog();