protected override void OnStartup(StartupEventArgs e) { Window mainWindow = null; // check some state or setting as appropriate if (ConfigurationManager.AppSettings["AdvancedMode"] == "1") { mainWindow = new OtherWindow(); } else { mainWindow = new MainWindow(); } mainWindow.Show(); }
void OnOpenOtherWindow(object sender, RoutedEventArgs e) { var other = new OtherWindow(); other.Show(); }