public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void Button_Click(object sender, RoutedEventArgs e) { Window1 win1 = new Window1(); win1.Show(); this.Close(); } }