예제 #1
0
 /// <summary>
 /// Handles the Click event of the RestartBtn 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 RestartBtn_Click(object sender, RoutedEventArgs e)
 {
     if ((MessageBox.Show("Are you sure you want to go back to restart?", "Confirm action", MessageBoxButton.OKCancel))
         == MessageBoxResult.OK)
     {
         UCMaze.DrawMaze();
     }
 }
예제 #2
0
 /// <summary>
 /// Handles the Click event of the SolveBtn 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 SolveBtn_Click(object sender, RoutedEventArgs e)
 {
     if (this.psvm.VM_Solution == null)
     {
         this.psvm.SolveMaze();
     }
     UCMaze.DrawMaze();
     UCMaze.ShowSolution();
 }
예제 #3
0
 /// <summary>
 /// Handles the Loaded event of the UCMaze 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 UCMaze_Loaded(object sender, RoutedEventArgs e)
 {
     UCMaze.DrawMaze();
     this.KeyDown += UCMaze.mazeUC_KeyDown;
 }