示例#1
0
        /// <summary>
        /// Handles the Click event of the btnStart control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void btnStart_Click(object sender, RoutedEventArgs e)
        {
            vm.MazeName = UserControl.TxtMazeName;
            vm.Rows     = UserControl.TxtRows;
            vm.Cols     = UserControl.TxtCols;

            SinglePlayerView sp = new SinglePlayerView(vm);

            sp.Show();
            this.Close();
            vm.GenerateMaze(vm.MazeName, vm.Rows, vm.Cols);
        }
示例#2
0
        /// <summary>
        /// Handles the Click event of the Button control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                spVM.GenerateMaze();
            }
            catch (Exception)
            {
                NotifyCommunicationProblem();
            }
            SinglePlayerGameWindow spGW = new SinglePlayerGameWindow(spVM.model);

            spGW.Show();
            this.Close();
        }