#pragma warning disable CS0628 // New protected member declared in sealed class protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) #pragma warning restore CS0628 // New protected member declared in sealed class { // When initialized asynchronously, the current thread may be a background thread at this point. // Do any initialization that requires the UI thread after switching to the UI thread. await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); try { await SharedRapidXamlPackage.InitializeAsync(cancellationToken, this); SharedRapidXamlPackage.Logger.RecordNotice(StringRes.Info_LaunchVersionGeneration.WithParams(CoreDetails.GetVersion())); SharedRapidXamlPackage.Logger.RecordNotice(string.Empty); await CopyToClipboardCommand.InitializeAsync(this, SharedRapidXamlPackage.Logger); await SendToToolboxCommand.InitializeAsync(this, SharedRapidXamlPackage.Logger); await OpenOptionsCommand.InitializeAsync(this, SharedRapidXamlPackage.Logger); await RapidXamlDropHandlerProvider.InitializeAsync(this, SharedRapidXamlPackage.Logger); // Set the ServiceProvider of CodeParserBase as it's needed to get settings CodeParserBase.ServiceProvider = this; if (SharedRapidXamlPackage.Logger != null) { SharedRapidXamlPackage.Logger.UseExtendedLogging = CodeParserBase.GetSettings().ExtendedOutputEnabled; } } catch (Exception exc) { SharedRapidXamlPackage.Logger?.RecordException(exc); } }
public ViewModelBase() { LoadFileCommand = new LoadFileCommand(this); RenameCommand = new RenameCommand(this); UndoCommand = new UndoCommand(this); CopyToClipboardCommand = new CopyToClipboardCommand(this); FileList = new ObservableCollection <File>(); }
public MissingInvoicesViewModel(DocumentHandlerViewModel documentHandlerViewModel) { docHandler = new DocHandler(); MissingInvoices = docHandler.GetPurchaseDocumentsAs_SupplierPurchaseInvoicesGrouping( documentHandlerViewModel.InvoiceContent.Where(d => d.FileWasMoved == false).ToList()); CloseWindowCommand = new CloseWindowCommand(this); CopyToClipboardCommand = new CopyToClipboardCommand(this); }
public InstanceDetailsViewModel( BaseService instance, EditServiceControlAuditInstanceCommand showAuditEditScreenCommand, EditServiceControlInstanceCommand showServiceControlEditScreenCommand, EditMonitoringInstanceCommand showEditMonitoringScreenCommand, UpgradeServiceControlInstanceCommand upgradeServiceControlCommand, UpgradeMonitoringInstanceCommand upgradeMonitoringCommand, UpgradeAuditInstanceCommand upgradeAuditCommand, AdvancedMonitoringOptionsCommand advancedOptionsMonitoringCommand, AdvancedServiceControlOptionsCommand advancedOptionsServiceControlCommand, ServiceControlInstanceInstaller serviceControlinstaller, ServiceControlAuditInstanceInstaller serviceControlAuditInstaller, MonitoringInstanceInstaller monitoringinstaller) { OpenUrl = new OpenURLCommand(); CopyToClipboard = new CopyToClipboardCommand(); StartCommand = Command.Create(() => StartService()); StopCommand = Command.Create(() => StopService()); ServiceInstance = instance; if (instance.GetType() == typeof(ServiceControlInstance)) { ServiceControlInstance = (ServiceControlInstance)instance; NewVersion = serviceControlinstaller.ZipInfo.Version; EditCommand = showServiceControlEditScreenCommand; UpgradeToNewVersionCommand = upgradeServiceControlCommand; AdvancedOptionsCommand = advancedOptionsServiceControlCommand; InstanceType = InstanceType.ServiceControl; return; } if (instance.GetType() == typeof(MonitoringInstance)) { MonitoringInstance = (MonitoringInstance)instance; NewVersion = monitoringinstaller.ZipInfo.Version; EditCommand = showEditMonitoringScreenCommand; UpgradeToNewVersionCommand = upgradeMonitoringCommand; AdvancedOptionsCommand = advancedOptionsMonitoringCommand; InstanceType = InstanceType.Monitoring; return; } if (instance.GetType() == typeof(ServiceControlAuditInstance)) { ServiceControlAuditInstance = (ServiceControlAuditInstance)instance; NewVersion = serviceControlAuditInstaller.ZipInfo.Version; EditCommand = showAuditEditScreenCommand; UpgradeToNewVersionCommand = upgradeAuditCommand; AdvancedOptionsCommand = advancedOptionsServiceControlCommand; InstanceType = InstanceType.ServiceControlAudit; return; } throw new Exception("Unknown instance type"); }
public VideoInfomationPageViewModel( ILoggerFactory loggerFactory, ApplicationLayoutManager applicationLayoutManager, AppearanceSettings appearanceSettings, VideoFilteringSettings ngSettings, NiconicoSession niconicoSession, LoginUserOwnedMylistManager userMylistManager, NicoVideoProvider nicoVideoProvider, LoginUserMylistProvider loginUserMylistProvider, SubscriptionManager subscriptionManager, NicoVideoSessionProvider nicoVideo, PageManager pageManager, Services.NotificationService notificationService, Services.DialogService dialogService, VideoPlayWithQueueCommand videoPlayWithQueueCommand, MylistAddItemCommand addMylistCommand, LocalPlaylistAddItemCommand localPlaylistAddItemCommand, AddSubscriptionCommand addSubscriptionCommand, OpenLinkCommand openLinkCommand, CopyToClipboardCommand copyToClipboardCommand, CopyToClipboardWithShareTextCommand copyToClipboardWithShareTextCommand, OpenShareUICommand openShareUICommand, CacheAddRequestCommand cacheAddRequestCommand, RecommendProvider recommendProvider, UserFollowProvider userFollowProvider, ChannelFollowProvider channelFollowProvider ) { _logger = loggerFactory.CreateLogger <VideoInfomationPageViewModel>(); ApplicationLayoutManager = applicationLayoutManager; AppearanceSettings = appearanceSettings; NgSettings = ngSettings; NiconicoSession = niconicoSession; UserMylistManager = userMylistManager; NicoVideoProvider = nicoVideoProvider; LoginUserMylistProvider = loginUserMylistProvider; SubscriptionManager = subscriptionManager; NicoVideo = nicoVideo; PageManager = pageManager; NotificationService = notificationService; DialogService = dialogService; VideoPlayWithQueueCommand = videoPlayWithQueueCommand; AddMylistCommand = addMylistCommand; LocalPlaylistAddItemCommand = localPlaylistAddItemCommand; AddSubscriptionCommand = addSubscriptionCommand; OpenLinkCommand = openLinkCommand; CopyToClipboardCommand = copyToClipboardCommand; CopyToClipboardWithShareTextCommand = copyToClipboardWithShareTextCommand; OpenShareUICommand = openShareUICommand; CacheAddRequestCommand = cacheAddRequestCommand; _recommendProvider = recommendProvider; _userFollowProvider = userFollowProvider; _channelFollowProvider = channelFollowProvider; NowLoading = new ReactiveProperty <bool>(false); IsLoadFailed = new ReactiveProperty <bool>(false); }
public MonitoringAdvancedViewModel(BaseService instance, IEventAggregator eventAggregator, DeleteMonitoringlnstanceCommand deleteInstanceCommand) { MonitoringInstance = (MonitoringInstance)instance; DisplayName = "ADVANCED OPTIONS"; DeleteCommand = deleteInstanceCommand; CopyToClipboard = new CopyToClipboardCommand(); Cancel = Command.Create(() => { TryClose(false); eventAggregator.PublishOnUIThread(new RefreshInstances()); }, () => !InProgress); }
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { // When initialized asynchronously, the current thread may be a background thread at this point. // Do any initialization that requires the UI thread after switching to the UI thread. await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); var rxtLogger = new RxtLogger(); var config = new RxtSettings(); var telemLogger = TelemetryAccessor.Create(rxtLogger, config.TelemetryKey); Logger = new RxtLoggerWithTelemtry(rxtLogger, telemLogger); try { // Set the ServiceProvider of CodeParserBase as it's needed to get settings CodeParserBase.ServiceProvider = this; Logger.RecordInfo(StringRes.Info_ProblemsInstructionsAndLink); Logger.RecordInfo(StringRes.Info_IntializingCommands.WithParams(CoreDetails.GetVersion())); await CreateViewCommand.InitializeAsync(this, Logger); await CopyToClipboardCommand.InitializeAsync(this, Logger); await SendToToolboxCommand.InitializeAsync(this, Logger); await OpenOptionsCommand.InitializeAsync(this, Logger); await SetDatacontextCommand.InitializeAsync(this, Logger); await MoveAllHardCodedStringsToResourceFileCommand.InitializeAsync(this, Logger); await RapidXamlDropHandlerProvider.InitializeAsync(this, Logger); await this.SetUpRunningDocumentTableEventsAsync(cancellationToken); RapidXamlDocumentCache.Initialize(this); } catch (Exception exc) { Logger.RecordException(exc); throw; // Remove for launch. see issue #90 } }
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { // When initialized asynchronously, the current thread may be a background thread at this point. // Do any initialization that requires the UI thread after switching to the UI thread. await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); var rxtLogger = new RxtLogger(); var telemKey = string.Empty; var telemLogger = TelemetryAccessor.Create(rxtLogger, telemKey); Logger = new RxtLoggerWithTelemtry(rxtLogger, telemLogger); try { // Set the ServiceProvider of AnalyzerBase as it's needed to get settings AnalyzerBase.ServiceProvider = this; Logger.RecordInfo(StringRes.Info_IntializingCommands.WithParams(CoreDetails.GetVersion())); await CreateViewCommand.InitializeAsync(this, Logger); await CopyToClipboardCommand.InitializeAsync(this, Logger); await SendToToolboxCommand.InitializeAsync(this, Logger); await OpenOptionsCommand.InitializeAsync(this, Logger); await SetDatacontextCommand.InitializeAsync(this, Logger); await InsertGridRowDefinitionCommand.InitializeAsync(this, Logger); await RapidXamlDropHandlerProvider.InitializeAsync(this, Logger); } catch (Exception exc) { Logger.RecordException(exc); throw; // Remove for launch. see issue #90 } }
public InstanceDetailsViewModel( ServiceControlInstance serviceControlInstance, EditInstanceCommand showEditInstanceScreenCommand, UpgradeInstanceCommand upgradeInstanceToNewVersionCommand, AdvanceOptionsCommand advanceOptionsCommand, Installer installer) { ServiceControlInstance = serviceControlInstance; NewVersion = installer.ZipInfo.Version; OpenUrl = new OpenURLCommand(); CopyToClipboard = new CopyToClipboardCommand(); EditCommand = showEditInstanceScreenCommand; UpgradeToNewVersionCommand = upgradeInstanceToNewVersionCommand; StartCommand = Command.Create(() => StartService()); StopCommand = Command.Create(() => StopService()); AdvanceOptionsCommand = advanceOptionsCommand; }
public LiveCommentsSidePaneContentViewModel( CommentFilteringFacade commentFiltering, IScheduler scheduler, NicoVideoOwnerCacheRepository nicoVideoOwnerRepository, OpenLinkCommand openLinkCommand, CopyToClipboardCommand copyToClipboardCommand ) { _playerSettings = commentFiltering; _scheduler = scheduler; _nicoVideoOwnerRepository = nicoVideoOwnerRepository; OpenLinkCommand = openLinkCommand; CopyToClipboardCommand = copyToClipboardCommand; NicoLiveUserIdAddToNGCommand = new NicoLiveUserIdAddToNGCommand(_playerSettings, _nicoVideoOwnerRepository); NicoLiveUserIdRemoveFromNGCommand = new NicoLiveUserIdRemoveFromNGCommand(_playerSettings); IsCommentListScrollWithVideo = new ReactiveProperty <bool>(_scheduler, false) .AddTo(_CompositeDisposable); NGUsers = new ObservableCollection <CommentFliteringRepository.FilteringCommentOwnerId>(_playerSettings.GetFilteringCommentOwnerIdList()); IsNGCommentUserIdEnabled = _playerSettings.ToReactivePropertyAsSynchronized(x => x.IsEnableFilteringCommentOwnerId, _scheduler) .AddTo(_CompositeDisposable); }
public ServiceControlAdvancedViewModel(BaseService instance, IEventAggregator eventAggregator, StartServiceControlInMaintenanceModeCommand maintenanceModeCommand, DeleteServiceControlInstanceCommand deleteInstanceCommand) { ServiceControlInstance = (ServiceControlInstance)instance; DisplayName = "ADVANCED OPTIONS"; StartServiceInMaintenanceModeCommand = new ReactiveCommand().DoAsync(async _ => { await maintenanceModeCommand.ExecuteAsync(this); eventAggregator.PublishOnUIThread(new RefreshInstances()); }); DeleteCommand = deleteInstanceCommand; OpenUrl = new OpenURLCommand(); CopyToClipboard = new CopyToClipboardCommand(); StopMaintenanceModeCommand = new ReactiveCommand().DoAsync(async _ => { await StopService(); eventAggregator.PublishOnUIThread(new RefreshInstances()); }); Cancel = Command.Create(() => { TryClose(false); eventAggregator.PublishOnUIThread(new RefreshInstances()); }, () => !InProgress); }
// TODO: 視聴開始(会場後のみ、チャンネル会員限定やチケット必要な場合あり) // TODO: タイムシフト予約(tsがある場合のみ、会場前のみ、プレミアムの場合は会場後でも可) // TODO: 後からタイムシフト予約(プレミアムの場合のみ) // TODO: 配信説明 // TODO: タグ // TODO: 配信者(チャンネルやコミュニティ)の概要説明 // TODO: 配信者(チャンネルやコミュニティ)のフォロー // TODO: オススメ生放送(放送中、放送予定を明示) // TODO: ニコニコ市場 // TODO: SNS共有 // gateとwatchをどちらも扱った上でその差を意識させないように表現する // LiveInfo.Video.CurrentStatusは開演前、放送中は時間の経過によって変化する可能性がある public LiveInfomationPageViewModel( ApplicationLayoutManager applicationLayoutManager, AppearanceSettings appearanceSettings, PageManager pageManager, NiconicoSession niconicoSession, NicoLiveProvider nicoLiveProvider, DialogService dialogService, OpenLiveContentCommand openLiveContentCommand, OpenLinkCommand openLinkCommand, CopyToClipboardCommand copyToClipboardCommand, CopyToClipboardWithShareTextCommand copyToClipboardWithShareTextCommand ) { ApplicationLayoutManager = applicationLayoutManager; _appearanceSettings = appearanceSettings; PageManager = pageManager; NiconicoSession = niconicoSession; NicoLiveProvider = nicoLiveProvider; HohoemaDialogService = dialogService; OpenLiveContentCommand = openLiveContentCommand; OpenLinkCommand = openLinkCommand; CopyToClipboardCommand = copyToClipboardCommand; CopyToClipboardWithShareTextCommand = copyToClipboardWithShareTextCommand; IsLoadFailed = new ReactiveProperty <bool>(false) .AddTo(_CompositeDisposable); LoadFailedMessage = new ReactiveProperty <string>() .AddTo(_CompositeDisposable); IsLiveIdAvairable = this.ObserveProperty(x => x.LiveId) .Select(x => x != default(LiveId)) .ToReadOnlyReactiveProperty() .AddTo(_CompositeDisposable); IsLoggedIn = NiconicoSession.ObserveProperty(x => x.IsLoggedIn) .ToReadOnlyReactiveProperty() .AddTo(_CompositeDisposable); IsPremiumAccount = NiconicoSession.ObserveProperty(x => x.IsPremiumAccount) .ToReadOnlyReactiveProperty() .AddTo(_CompositeDisposable); _IsTsPreserved = new ReactiveProperty <bool>(false) .AddTo(_CompositeDisposable); LiveTags = new ReadOnlyObservableCollection <LiveTagViewModel>(_LiveTags); IchibaItems = new ReadOnlyObservableCollection <IchibaItem>(_IchibaItems); /* * ReccomendItems = _ReccomendItems.ToReadOnlyReactiveCollection(x => * { * var liveId = x.ProgramId; * var liveInfoVM = new LiveInfoListItemViewModel(liveId); * liveInfoVM.Setup(x); * * var reserve = _Reservations?.ReservedProgram.FirstOrDefault(reservation => liveId == reservation.Id); * if (reserve != null) * { * liveInfoVM.SetReservation(reserve); * } * * return liveInfoVM; * }) * .AddTo(_CompositeDisposable); */ IsShowOpenLiveContentButton = new[] { this.ObserveProperty(x => LiveProgram).ToUnit(), NiconicoSession.ObserveProperty(x => x.IsLoggedIn).ToUnit(), _IsTsPreserved.ToUnit() } .Merge() .Select(x => { if (LiveProgram == null) { return(false); } if (NiconicoSession.IsPremiumAccount) { if (LiveProgram.OnAirTime.BeginAt > DateTime.Now) { return(false); } return(LiveProgram.Timeshift.Enabled); } else { // 一般アカウントは放送中のみ if (LiveProgram.OnAirTime.BeginAt > DateTime.Now) { return(false); } if (_IsTsPreserved.Value) { return(true); } if (LiveProgram.OnAirTime.EndAt < DateTime.Now) { return(false); } return(true); } }) .ToReadOnlyReactiveProperty() .AddTo(_CompositeDisposable); IsShowAddTimeshiftButton = new [] { this.ObserveProperty(x => LiveProgram).ToUnit(), NiconicoSession.ObserveProperty(x => x.IsLoggedIn).ToUnit(), _IsTsPreserved.ToUnit() } .Merge() .Select(x => { if (LiveProgram == null) { return(false); } if (!LiveProgram.Timeshift.Enabled) { return(false); } if (!NiconicoSession.IsLoggedIn) { return(false); } if (!NiconicoSession.IsPremiumAccount) { // 一般アカウントは放送開始の30分前からタイムシフトの登録はできなくなる if ((LiveProgram.ShowTime.BeginAt - TimeSpan.FromMinutes(30)) < DateTime.Now) { return(false); } } // 放送前、及び放送中はタイムシフトボタンを非表示…? // プレ垢なら常に表示しておいていいんじゃないの? //if (LiveProgram.ShowTime.EndAt > DateTime.Now) { return false; } // タイムシフト予約済み if (_IsTsPreserved.Value) { return(false); } return(true); }) .ToReadOnlyReactiveProperty() .AddTo(_CompositeDisposable); IsShowDeleteTimeshiftButton = _IsTsPreserved; }
public void SetUp() { _clipboardService = Substitute.For <IClipboardService>(); _copyToClipboardCommand = new CopyToClipboardCommand(_clipboardService); }
public MessageDialogViewModel() { this.InitializeAsDialog(); CopyToClipboardCommand .Subscribe(() => Clipboard.SetText(Message ?? string.Empty)); }
public VideoPlayerPageViewModel( ILoggerFactory loggerFactory, IScheduler scheduler, IPlayerView playerView, NiconicoSession niconicoSession, SubscriptionManager subscriptionManager, NicoVideoProvider nicoVideoProvider, ChannelProvider channelProvider, MylistProvider mylistProvider, AppearanceSettings appearanceSettings, PlayerSettings playerSettings, VideoCacheSettings_Legacy cacheSettings, ApplicationLayoutManager applicationLayoutManager, LocalMylistManager localMylistManager, LoginUserOwnedMylistManager userMylistManager, PageManager pageManager, QueuePlaylist queuePlaylist, HohoemaPlaylistPlayer hohoemaPlaylistPlayer, MediaPlayer mediaPlayer, VideoTogglePlayPauseCommand videoTogglePlayPauseCommand, NotificationService notificationService, DialogService dialogService, AddSubscriptionCommand addSubscriptionCommand, LocalPlaylistCreateCommand createLocalMylistCommand, MylistAddItemCommand addMylistCommand, LocalPlaylistAddItemCommand localPlaylistAddItemCommand, MylistCreateCommand createMylistCommand, VideoStreamingOriginOrchestrator videoStreamingOriginOrchestrator, VideoCommentPlayer commentPlayer, CommentCommandEditerViewModel commentCommandEditerViewModel, KeepActiveDisplayWhenPlaying keepActiveDisplayWhenPlaying, ObservableMediaPlayer observableMediaPlayer, VideoEndedRecommendation videoEndedRecommendation, PrimaryViewPlayerManager primaryViewPlayerManager, TogglePlayerDisplayViewCommand togglePlayerDisplayViewCommand, ShowPrimaryViewCommand showPrimaryViewCommand, MediaPlayerSoundVolumeManager soundVolumeManager, OpenLinkCommand openLinkCommand, CopyToClipboardCommand copyToClipboardCommand, ChangeVideoQualityCommand changeVideoQualityCommand, CopyToClipboardWithShareTextCommand copyToClipboardWithShareTextCommand, OpenShareUICommand openShareUICommand, PlaylistSidePaneContentViewModel playlistSidePaneContentViewModel, SettingsSidePaneContentViewModel settingsSidePaneContentViewModel, VideoCommentSidePaneContentViewModel videoCommentSidePaneContent, RelatedVideosSidePaneContentViewModel relatedVideosSidePaneContentViewModel ) { _logger = loggerFactory.CreateLogger <VideoPlayerPageViewModel>(); CurrentPlayerDisplayView = appearanceSettings .ObserveProperty(x => x.PlayerDisplayView) .ToReadOnlyReactivePropertySlim() .AddTo(_CompositeDisposable); _scheduler = scheduler; PlayerView = playerView; NiconicoSession = niconicoSession; SubscriptionManager = subscriptionManager; NicoVideoProvider = nicoVideoProvider; ChannelProvider = channelProvider; MylistProvider = mylistProvider; PlayerSettings = playerSettings; CacheSettings = cacheSettings; ApplicationLayoutManager = applicationLayoutManager; LocalMylistManager = localMylistManager; UserMylistManager = userMylistManager; PageManager = pageManager; _queuePlaylist = queuePlaylist; _hohoemaPlaylistPlayer = hohoemaPlaylistPlayer; _NotificationService = notificationService; _HohoemaDialogService = dialogService; AddSubscriptionCommand = addSubscriptionCommand; CreateLocalMylistCommand = createLocalMylistCommand; AddMylistCommand = addMylistCommand; LocalPlaylistAddItemCommand = localPlaylistAddItemCommand; CreateMylistCommand = createMylistCommand; _videoStreamingOriginOrchestrator = videoStreamingOriginOrchestrator; CommentPlayer = commentPlayer; CommentCommandEditerViewModel = commentCommandEditerViewModel; PrimaryViewPlayerManager = primaryViewPlayerManager; TogglePlayerDisplayViewCommand = togglePlayerDisplayViewCommand; ShowPrimaryViewCommand = showPrimaryViewCommand; SoundVolumeManager = soundVolumeManager; OpenLinkCommand = openLinkCommand; CopyToClipboardCommand = copyToClipboardCommand; ChangeVideoQualityCommand = changeVideoQualityCommand; CopyToClipboardWithShareTextCommand = copyToClipboardWithShareTextCommand; OpenShareUICommand = openShareUICommand; _playlistSidePaneContentViewModel = playlistSidePaneContentViewModel; _settingsSidePaneContentViewModel = settingsSidePaneContentViewModel; _videoCommentSidePaneContentViewModel = videoCommentSidePaneContent; _relatedVideosSidePaneContentViewModel = relatedVideosSidePaneContentViewModel; ObservableMediaPlayer = observableMediaPlayer .AddTo(_CompositeDisposable); VideoEndedRecommendation = videoEndedRecommendation .AddTo(_CompositeDisposable); _keepActiveDisplayWhenPlaying = keepActiveDisplayWhenPlaying .AddTo(_CompositeDisposable); MediaPlayer = mediaPlayer; VideoTogglePlayPauseCommand = videoTogglePlayPauseCommand; SeekCommand = new MediaPlayerSeekCommand(MediaPlayer); SetPlaybackRateCommand = new MediaPlayerSetPlaybackRateCommand(MediaPlayer); ToggleMuteCommand = new MediaPlayerToggleMuteCommand(MediaPlayer); VolumeUpCommand = new MediaPlayerVolumeUpCommand(SoundVolumeManager); VolumeDownCommand = new MediaPlayerVolumeDownCommand(SoundVolumeManager); PlayNextCommand = _hohoemaPlaylistPlayer.GetCanGoNextOrPreviewObservable() .SelectMany(async x => await _hohoemaPlaylistPlayer.CanGoNextAsync()) .ToAsyncReactiveCommand() .AddTo(_CompositeDisposable); PlayNextCommand.Subscribe(async() => await _hohoemaPlaylistPlayer.GoNextAsync(NavigationCancellationToken)) .AddTo(_CompositeDisposable); PlayPreviousCommand = _hohoemaPlaylistPlayer.GetCanGoNextOrPreviewObservable() .SelectMany(async x => await _hohoemaPlaylistPlayer.CanGoPreviewAsync()) .ToAsyncReactiveCommand() .AddTo(_CompositeDisposable); PlayPreviousCommand.Subscribe(async() => await _hohoemaPlaylistPlayer.GoPreviewAsync(NavigationCancellationToken)) .AddTo(_CompositeDisposable); IsLoopingEnabled = PlayerSettings.ToReactivePropertyAsSynchronized(x => x.IsCurrentVideoLoopingEnabled, raiseEventScheduler: scheduler) .AddTo(_CompositeDisposable); IsLoopingEnabled.Subscribe(x => mediaPlayer.IsLoopingEnabled = x) .AddTo(_CompositeDisposable); IsPlaylistShuffleRequeted = PlayerSettings.ToReactivePropertyAsSynchronized(x => x.IsShuffleEnable, _scheduler) .AddTo(_CompositeDisposable); IsAvailablePlaylistRepeatOrShuffle = _hohoemaPlaylistPlayer.ObserveProperty(x => x.IsShuffleAndRepeatAvailable) .ToReadOnlyReactiveProperty(); }