Esempio n. 1
0
        /// <summary>
        /// Register commands
        /// </summary>
        private void RegisterCommands()
        {
            LoadShowCommand = new RelayCommand <ShowLightJson>(async show =>
                                                               await LoadShow(show, CancellationLoadingToken.Token));
            GoToTMDbCommand = new RelayCommand <string>(e =>
            {
                Process.Start($"https://www.themoviedb.org/tv/{e}");
            });

            PlayTrailerCommand = new RelayCommand(async() =>
            {
                IsPlayingTrailer = true;
                IsTrailerLoading = true;
                await _showTrailerService.LoadTrailerAsync(Show, CancellationLoadingTrailerToken.Token);
                IsTrailerLoading = false;
            });

            StopLoadingTrailerCommand = new RelayCommand(StopLoadingTrailer);

            StopLoadingShowCommand = new RelayCommand(() =>
            {
                StopLoadingShow();
                Messenger.Default.Send(new StopPlayingEpisodeMessage());
            });
        }
        /// <summary>
        /// Register commands
        /// </summary>
        private void RegisterCommands()
        {
            LoadShowCommand = new RelayCommand <ShowJson>(LoadShow);

            PlayTrailerCommand = new RelayCommand(async() =>
            {
                IsPlayingTrailer = true;
                IsTrailerLoading = true;
                await _showTrailerService.LoadTrailerAsync(Show, CancellationLoadingTrailerToken.Token);
                IsTrailerLoading = false;
            });

            StopLoadingTrailerCommand = new RelayCommand(StopLoadingTrailer);
        }
Esempio n. 3
0
        /// <summary>
        /// Register commands
        /// </summary>
        private void RegisterCommands()
        {
            LoadShowCommand = new RelayCommand <ShowLightJson>(async show => await LoadShow(show).ConfigureAwait(false));

            PlayTrailerCommand = new RelayCommand(async() =>
            {
                await Task.Run(async() =>
                {
                    IsPlayingTrailer = true;
                    IsTrailerLoading = true;
                    await _showTrailerService.LoadTrailerAsync(Show, CancellationLoadingTrailerToken.Token).ConfigureAwait(false);
                    IsTrailerLoading = false;
                });
            });

            StopLoadingTrailerCommand = new RelayCommand(StopLoadingTrailer);
        }
Esempio n. 4
0
        /// <summary>
        /// Register commands
        /// </summary>
        private void RegisterCommands()
        {
            LoadShowCommand = new RelayCommand <ShowLightJson>(async show => await LoadShow(show).ConfigureAwait(false));
            GoToImdbCommand = new RelayCommand <string>(e =>
            {
                Process.Start($"http://www.imdb.com/title/{e}");
            });

            PlayTrailerCommand = new RelayCommand(async() =>
            {
                await Task.Run(async() =>
                {
                    IsPlayingTrailer = true;
                    IsTrailerLoading = true;
                    await _showTrailerService.LoadTrailerAsync(Show, CancellationLoadingTrailerToken.Token).ConfigureAwait(false);
                    IsTrailerLoading = false;
                });
            });

            StopLoadingTrailerCommand = new RelayCommand(StopLoadingTrailer);
        }