Esempio n. 1
0
        /// <summary>
        /// Loads the game from a file and show the game window.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LoadGameClicked(object sender, RoutedEventArgs e)
        {
            try
            {
                var game = GameBuilder.LoadGame(_gameName.Text);

                var main = Application.Current.MainWindow;
                var gameWindow = new GameWindow(game);
                Application.Current.MainWindow = gameWindow;
                main.Close();
                gameWindow.Show();
            }
            catch (Exception _)
            {
                Opacity = 0.5;
                var dialog = new LoadErrorWindow();
                dialog.ShowDialog();
                Opacity = 1;
            }
        }
        /// <summary>
        /// Loads the game from a file and show the game window.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LoadGameClicked(object sender, RoutedEventArgs e)
        {
            try
            {
                var game = GameBuilder.LoadGame(_gameName.Text);

                var main       = Application.Current.MainWindow;
                var gameWindow = new GameWindow(game);
                Application.Current.MainWindow = gameWindow;
                main.Close();
                gameWindow.Show();
            }
            catch (Exception _)
            {
                Opacity = 0.5;
                var dialog = new LoadErrorWindow();
                dialog.ShowDialog();
                Opacity = 1;
            }
        }