/// <summary> /// Handles the Click event of the NormalButton 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 NormalButton_Click(object sender, RoutedEventArgs e) { try { optionsViewModel.OptionModel.Difficulty = 2; optionsViewModel.SaveToXml(); GamePlayWindow childWindow = new GamePlayWindow(); this.Close(); childWindow.ShowDialog(); } catch (Exception error) { errorLogViewModel.LogError(error); } }
/// <summary> /// Handles the Click event of the EasyButton 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 EasyButton_Click(object sender, RoutedEventArgs e) { try { // Set the difficulty. optionsViewModel.OptionModel.Difficulty = 1; optionsViewModel.SaveToXml(); GamePlayWindow childWindow = new GamePlayWindow(); this.Close(); childWindow.ShowDialog(); } catch (Exception error) { errorLogViewModel.LogError(error); } }