Beispiel #1
0
 /// <summary>
 /// コマンド実行可否判定呼出
 /// </summary>
 private void RaiseCommandCanExecute()
 {
     StartGameCommand.RaiseCanExecuteChanged();
     StopGameCommand.RaiseCanExecuteChanged();
     AddPlayerCommand.RaiseCanExecuteChanged();
     DelPlayerCommand.RaiseCanExecuteChanged();
 }
 /// <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());
     }
 }
Beispiel #3
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());
     }
 }
 private void updateButtonCanExecute()
 {
     StartGameCommand.RaiseCanExecuteChanged();
     StopGameCommand.RaiseCanExecuteChanged();
     PauseGameCommand.RaiseCanExecuteChanged();
 }