private void btnLevel1_Click(object sender, RoutedEventArgs e)
        {
            LevelOne main = new LevelOne();

            App.Current.MainWindow = main;
            this.Close();
            main.Show();
        }
Exemple #2
0
        private void btnConfirm_Click(object sender, RoutedEventArgs e)
        {
            foreach (Window window in Application.Current.Windows.OfType <LevelOne>())
            {
                LevelOne openAgainLevelOne = new LevelOne();
                App.Current.MainWindow = openAgainLevelOne;
                this.Close();
                openAgainLevelOne.Show();
                if (window != openAgainLevelOne)
                {
                    window.Close();
                }
            }

            foreach (Window window in Application.Current.Windows.OfType <LevelTwo>())
            {
                LevelTwo openAgainLevelTwo = new LevelTwo();
                App.Current.MainWindow = openAgainLevelTwo;
                this.Close();
                openAgainLevelTwo.Show();
                if (window != openAgainLevelTwo)
                {
                    window.Close();
                }
            }



            foreach (Window window in Application.Current.Windows.OfType <LevelThree>())
            {
                LevelThree openAgainLevelThree = new LevelThree();
                App.Current.MainWindow = openAgainLevelThree;
                this.Close();
                openAgainLevelThree.Show();
                if (window != openAgainLevelThree)
                {
                    window.Close();
                }
            }
        }