Here’s the XAML code:
<Application x:Class="WpfApplication2.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Startup="Application_Startup" />
Backing code:
using System.Windows;
namespace WpfApplication2
{
public partial class App : Application
{
private void Application_Startup(object sender, StartupEventArgs e)
{
new Window().ShowDialog();
new Window().ShowDialog();
}
}
}
Window shows only one time and then application exits. Why??
UPDATE: I know that windows should show up consequently. But after I close first window second does not show up at all
Try this
Paste form comment:
I think when you close first window,application checks whether there are other windows,and it doesn’t find any (so application is closing), because second window haven’t been created