Пример #1
0
        private async Task GetMovieDetails(int movieId)
        {
            if (!IsDataLoaded)
            {
                try
                {
                    IsBusy        = true;
                    SelectedMovie = await _apiService.GetMovieDetails(movieId);

                    Casts = await _apiService.GetCastForMovie(movieId);

                    MovieImage = await _apiService.GetMovieImages(movieId);

                    TopCasts = Casts.GetRange(0, 4);
                    Videos   = await _apiService.GetMovieVideos(movieId);

                    IsDataLoaded = true;
                }
                catch (Exception ex)
                {
                    Debug.WriteLine("Execption movie details", ex);
                    await _pageService.DisplayAlert("Error", "Failed to load movie details", "OK", "Cancel");
                }
                finally
                {
                    IsBusy = false;
                }
            }
        }