/// <summary> /// Добавление эпизодов /// </summary> public async Task <bool> AddSouthPark() { if (CanAddAddSouthPark is false) { return(false); } AddingFilmCancellationTokenSource = new CancellationTokenSource(); AddingFilmToken = AddingFilmCancellationTokenSource.Token; try { var wvm = new WaitViewModel(); WinMan.ShowWindow(wvm); ((Window)((MainViewModel)Parent).GetView()).IsEnabled = false; await CreateSP(wvm); ((Window)((MainViewModel)Parent).GetView()).IsEnabled = true; wvm.TryClose(); } catch (Exception e) { WinMan.ShowWindow(new DialogViewModel(e.ToString(), DialogType.Error, e)); return(false); } Films = new BindableCollection <Film>(GetDbCollection <Film>()); return(AddingFilmToken.IsCancellationRequested is false); }
/// <summary> /// Действие при старте просмотра /// </summary> public void Start() { if (CanStart is false) { return; } CreateList(); ActivateDeactivateTray((Window)((MainViewModel)Parent).GetView()); VideoPlayer = new VideoPlayerViewModel(this, WatchingEpisodesCount, CheckedEpisodes) { MainView = (Window)((MainViewModel)Parent).GetView() }; WinMan.ShowWindow(VideoPlayer); NotifyOfPropertyChange(() => EpisodesCountRemainingString); NotifyOfPropertyChange(() => CanStart); }