Example #1
0
        private async void LoadViewModels()
        {
            PresentationManager.ShowLoadingAnimation();

            var cancellationSource = _mainViewCancellationTokenSource = new CancellationTokenSource();

            try
            {
                var view = await ApiClient.GetMovieView(_sessionManager.CurrentUser.Id, ParentId, cancellationSource.Token);

                _moviesView = view;

                LoadSpotlightViewModel(view);
                LoadAllMoviesViewModel(view);
                LoadMiniSpotlightsViewModel(view);
                LoadLatestMoviesViewModel(view);
                LoadLatestTrailersViewModel(view);

                LatestMoviesViewModel.CurrentItemUpdated   += LatestMoviesViewModel_OnCurrentItemUpdated;
                LatestTrailersViewModel.CurrentItemUpdated += LatestTrailersViewModel_OnCurrentItemUpdated;
                MiniSpotlightsViewModel.CurrentItemUpdated += MiniSpotlightsViewModel_OnCurrentItemUpdated;
            }
            catch (Exception ex)
            {
                _logger.ErrorException("Error getting movie view", ex);
                PresentationManager.ShowDefaultErrorMessage();
            }
            finally
            {
                PresentationManager.HideLoadingAnimation();
                DisposeMainViewCancellationTokenSource(false);
            }
        }
Example #2
0
        private async void LoadViewModels()
        {
            PresentationManager.ShowLoadingAnimation();

            var cancellationSource = _mainViewCancellationTokenSource = new CancellationTokenSource();

            try
            {
                var view = await ApiClient.GetMovieView(_sessionManager.CurrentUser.Id, cancellationSource.Token);

                LoadSpotlightViewModel(view);
                LoadBoxsetsViewModel(view);
                LoadTrailersViewModel(view);
                LoadAllMoviesViewModel(view);
                LoadHDMoviesViewModel(view);
                LoadFamilyMoviesViewModel(view);
                Load3DMoviesViewModel(view);
                LoadComedyMoviesViewModel(view);
                LoadRomanticMoviesViewModel(view);
                LoadActorsViewModel(view);
                LoadMiniSpotlightsViewModel(view);
                LoadMiniSpotlightsViewModel2(view);
            }
            catch (Exception ex)
            {
                _logger.ErrorException("Error getting movie view", ex);
                PresentationManager.ShowDefaultErrorMessage();
            }
            finally
            {
                PresentationManager.HideLoadingAnimation();
                DisposeMainViewCancellationTokenSource(false);
            }
        }
Example #3
0
        private async void LoadViewModels()
        {
            PresentationManager.ShowLoadingAnimation();

            var cancellationSource = _mainViewCancellationTokenSource = new CancellationTokenSource();

            try
            {
                var view = await ApiClient.GetGamesView(_sessionManager.CurrentUser.Id, ParentId, cancellationSource.Token);

                _gamesView = view;

                LoadSpotlightViewModel(view);
                LoadGameSystemsViewModel(view);
                LoadMultiPlayerViewModel(view);
                LoadRecentlyPlayedViewModel(view);
            }
            catch (Exception ex)
            {
                _logger.ErrorException("Error getting games view", ex);
                PresentationManager.ShowDefaultErrorMessage();
            }
            finally
            {
                PresentationManager.HideLoadingAnimation();
                DisposeMainViewCancellationTokenSource(false);
            }
        }
        private async void LoadViewModels()
        {
            PresentationManager.ShowLoadingAnimation();

            try
            {
                var view = await ApiClient.GetFavoritesView(_sessionManager.CurrentUser.Id, CancellationToken.None);

                LoadSpotlightViewModel(view);
                LoadMoviesViewModel(view);
                LoadSeriesViewModel(view);
                LoadEpisodesViewModel(view);
                LoadGamesViewModel(view);
                LoadArtistsViewModel(view);
                LoadAlbumsViewModel(view);
                LoadSongsViewModel(view);
                LoadMiniSpotlightsViewModel(view);
                LoadMiniSpotlightsViewModel2(view);
            }
            catch (Exception ex)
            {
                _logger.ErrorException("Error getting home view", ex);
                PresentationManager.ShowDefaultErrorMessage();
            }
            finally
            {
                PresentationManager.HideLoadingAnimation();
            }
        }