有两种情况:
1.如果Page1.xaml指定了x:Class,则StartupUri="Page1.xaml"
2.如果Page1.xaml没有指定x:Class,则Startup="On_Startup",在后台的代码中:
private void On_Startup(object sender, StartupEventArgs args)
{
Page1 myWindow = new Page1();
myWindow.InitializeComponent();
myWindow.Show();
}
{
Page1 myWindow = new Page1();
myWindow.InitializeComponent();
myWindow.Show();
}