private void InitaliseCommands() { StartGameCommand = ReactiveCommand.Create(); StartGameCommand.Subscribe(arg => StartGameCommandHandler()); ResetCommand = ReactiveCommand.Create(); ResetCommand.Subscribe(arg => ResetCommandHandler()); StopGameCommand = ReactiveCommand.Create(); StopGameCommand.Subscribe(arg => StopGameWindowHandler()); OpenNewGameWindow = ReactiveCommand.Create(); OpenNewGameWindow.Subscribe(arg => OpenNewGameWindowHandler()); FlipCommand = ReactiveCommand.Create(); FlipCommand.Subscribe(arg => FlipCommandHandler()); UndoCommand = ReactiveCommand.Create(); UndoCommand.Subscribe(arg => UndoCommandHandler()); AcceptScoreCommand = ReactiveCommand.Create(); AcceptScoreCommand.Subscribe(arg => AcceptScoreCommandHandler()); RejectScoreCommand = ReactiveCommand.Create(); RejectScoreCommand.Subscribe(arg => RejectScoreCommandHandler()); }
/// <summary> /// コマンド実行可否判定呼出 /// </summary> private void RaiseCommandCanExecute() { StartGameCommand.RaiseCanExecuteChanged(); StopGameCommand.RaiseCanExecuteChanged(); AddPlayerCommand.RaiseCanExecuteChanged(); DelPlayerCommand.RaiseCanExecuteChanged(); }
public async Task <IActionResult> Stop(StopGameCommand stopGameCommand, string id) { var matchService = await _matchListService.GetMatchService(UserId, id); await matchService.AddEventAsync(new StopEvent { OccuredAt = DateTime.UtcNow }); return(RedirectToAction(nameof(Index), new { id })); }
/// <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()); } }
/// <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(); }