/// <summary> /// Handles the Click event of the btnReset 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 btnReset_Click(object sender, RoutedEventArgs e) { PopMessage resetMessage = new PopMessage("Do you want to reset this maze?", "No", "Yes"); if (resetMessage.ShowDialog() != true) { if (resetMessage.Choose == true) //reset the game { vm.Reset(); } } }
/// <summary> /// Handles the Click event of the btnSolve 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 btnSolve_Click(object sender, RoutedEventArgs e) { PopMessage solveMessage = new PopMessage("Do you want to solve this maze?", "No", "Yes"); if (solveMessage.ShowDialog() != true) { if (solveMessage.Choose == true) //solve the game { vm.Solve(); } } }
/// <summary> /// Handles the Click event of the btnMainMenu 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 btnMainMenu_Click(object sender, RoutedEventArgs e) { PopMessage exitMessage = new PopMessage("Do you want to exit this maze?", "No", "Yes"); if (exitMessage.ShowDialog() != true) { if (exitMessage.Choose == true) //exit the game { BackToMainMenu(); } } }
/// <summary> /// Called when [you won property changed]. /// </summary> private void OnYouWonPropertyChanged() { if (YouWon == true) { PopMessage youWonMessage = new PopMessage("You Won", "Keep playing", "Return to main menu"); if (youWonMessage.ShowDialog() != true) { if (youWonMessage.Choose == true) //solve the game { BackToMainMenu(); } } } YouWon = false; }