/// <summary> /// Handles the Click event of the Start_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 Start_Button_Click(object sender, RoutedEventArgs e) { if (this.MenuUserControl.TxtMazeName.Text.Equals(string.Empty) || this.MenuUserControl.TxtRows.Text.Equals(string.Empty) || this.MenuUserControl.TxtCols.Text.Equals(string.Empty)) { CheckArgsWindow win = new CheckArgsWindow(); win.Show(); } else { try { this.model.StartGame(); } catch (Exception excp) { this.NoConnection(); this.Close(); return; } SinglePlayerWindow win = new SinglePlayerWindow(this.model); win.Show(); this.Close(); } }
/// <summary> /// Handles the Click event of the Restart_Game_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 Restart_Game_Button_Click(object sender, RoutedEventArgs e) { this.vm.InitStartPos(); SinglePlayerWindow win = new SinglePlayerWindow(this.model); win.Show(); this.Close(); }