/// <summary>
 /// The OnGridPropertyChanged method is called when a property in the Grid model class changes.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnGridPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     try
     {
         StartGameCommand.RaiseCanExecuteChanged();
         StopGameCommand.RaiseCanExecuteChanged();
         StepGameCommand.RaiseCanExecuteChanged();
         ResetGameCommand.RaiseCanExecuteChanged();
     }
     catch (Exception ex)
     {
         throw new Exception("LangtonsAntViewModel.OnGridPropertyChanged(object sender, PropertyChangedEventArgs e): " + ex.ToString());
     }
 }
Example #2
0
 /// <summary>
 /// The OnGameOfLifePropertyChanged method is called when a property in the GameOfLife model class changes.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnGameOfLifePropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     try
     {
         StartGameCommand.RaiseCanExecuteChanged();
         StopGameCommand.RaiseCanExecuteChanged();
         StepGameCommand.RaiseCanExecuteChanged();
         ResetGameCommand.RaiseCanExecuteChanged();
         ToggleCellStateCommand.RaiseCanExecuteChanged();
     }
     catch (Exception ex)
     {
         throw new Exception("ConwaysGameOfLifeViewModel.OnGameOfLifePropertyChanged(object sender, PropertyChangedEventArgs e): " + ex.ToString());
     }
 }