public PlayerControlViewModel(PlayersViewModel parent, Player player) { _parent = parent; _player = player; ViewModelHelper.BindNotifyChanged(_player, this, (sender, e) => RaisePropertyChanged(e.PropertyName)); ViewModelHelper.BindNotifyChanged(_player.RecordDescription, this, (sender, e) => RaisePropertyChanged(e.PropertyName)); // IsPlayingの状態が変わったら、PlayCommand/StopCommandの有効無効を切り替える Observable.FromEventPattern <PropertyChangedEventArgs>(_player, "PropertyChanged") .Where(e => e.EventArgs.PropertyName == "IsPlaying" || e.EventArgs.PropertyName == "IsPausing") .Subscribe(_ => { _PlayCommand.RaiseCanExecuteChanged(); _PauseCommand.RaiseCanExecuteChanged(); _StopCommand.RaiseCanExecuteChanged(); }); Observable.FromEventPattern <PropertyChangedEventArgs>(_player, "PropertyChanged") .Where(e => e.EventArgs.PropertyName == "IsAlive") .Subscribe(_ => _ReinitializeCommand.RaiseCanExecuteChanged()); Observable.FromEventPattern <ErrorInfoEventArgs>(_player, "ErrorRaised") .Subscribe(e => Messenger.Raise(new InformationMessage(e.EventArgs.Message, "エラー", "ShowError"))); }
private void CheckAllStop() { if (RecordersViewModel.HasRecordingRecorder() || PlayersViewModel.HasPlayingPlayers()) { Messenger.Raise(new InteractionMessage("AllStop")); } }
public PlayerControlViewModel(PlayersViewModel parent, Player player) { _parent = parent; _player = player; ViewModelHelper.BindNotifyChanged(_player, this, (sender, e) => RaisePropertyChanged(e.PropertyName)); ViewModelHelper.BindNotifyChanged(_player.RecordDescription, this, (sender, e) => RaisePropertyChanged(e.PropertyName)); // IsPlayingの状態が変わったら、PlayCommand/StopCommandの有効無効を切り替える Observable.FromEventPattern<PropertyChangedEventArgs>(_player, "PropertyChanged") .Where(e => e.EventArgs.PropertyName == "IsPlaying" || e.EventArgs.PropertyName == "IsPausing") .Subscribe(_ => { _PlayCommand.RaiseCanExecuteChanged(); _PauseCommand.RaiseCanExecuteChanged(); _StopCommand.RaiseCanExecuteChanged(); }); Observable.FromEventPattern<PropertyChangedEventArgs>(_player, "PropertyChanged") .Where(e => e.EventArgs.PropertyName == "IsAlive") .Subscribe(_ => _ReinitializeCommand.RaiseCanExecuteChanged()); Observable.FromEventPattern<ErrorInfoEventArgs>(_player, "ErrorRaised") .Subscribe(e => Messenger.Raise(new InformationMessage(e.EventArgs.Message, "エラー", "ShowError"))); }
private void AllStop(ConfirmationMessage message) { if (message.Response.HasValue && message.Response.Value) { RecordersViewModel.StopAllRecorders(); PlayersViewModel.StopAllPlayers(); } }
public MainWindowViewModel() { _manager = NamingServiceManager.Default; RecordersViewModel = new RecordersViewModel(_manager); PlayersViewModel = new PlayersViewModel(_manager); SettingViewModel = new SettingViewModel(_manager); AnalysisViewModel = new AnalysisViewModel(_manager); }