protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e) { if (canMove() && MessageBox.Show("The current game will end.", "Exit to main menu?", MessageBoxButton.OKCancel) == MessageBoxResult.Cancel) { if (e != null) { e.Cancel = true; } return; } else { TURN_TIMER.Stop(); COMPUTER_DELAY.Stop(); wait_for_computer = false; wait_for_timer = false; player_turn = true; NavigationService.GoBack(); MainPage.game_state = GameState.MENU; } }
private void Computer_Delay_Tick(object o, EventArgs e) { COMPUTER_DELAY.Stop(); Make_Educated_Move(o, e); }