Exemple #1
0
        public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> state)
        {
            //Get the movie by Id
            var movieId      = (int)parameter;
            var movieService = new MovieServices();
            var movieTemp    = await movieService.GetMovieByIdAsync(movieId);

            this.setMovieDisplayable(movieTemp);
            this.Movie = movieTemp;
            //Get the credits of the movie
            this.Actors.Clear();
            this.SimiliarMovies.Clear();
            var credits = await movieService.GetMovieCredits(movieId);

            foreach (var item in credits.cast)
            {
                item.profile_path = "https://image.tmdb.org/t/p/w500/" + item.profile_path;
                this.Actors.Add(item);
            }
            var smiliarMoviesTemp = await movieService.GetSimiliarMoviesAsync(movieId);

            foreach (var item in smiliarMoviesTemp.movies)
            {
                item.poster_path = "https://image.tmdb.org/t/p/w500/" + item.poster_path;
                this.SimiliarMovies.Add(item);
            }
            if (smiliarMoviesTemp.movies.Count == 0)
            {
                this.SimiliarMoviesText = "";
            }
            else
            {
                this.SimiliarMoviesText = "Hasonló Filmek";
            }
            await base.OnNavigatedToAsync(parameter, mode, state);
        }