//Similares private async void ReturnData() { var connection = await this.apiService.CheckConnection(); if (!connection.IsSuccess) { await Application.Current.MainPage.DisplayAlert("Conexão de Rede", connection.Message, "OK"); return; } //var listGenres = await managerMovies.GetAllGenres(); var moviesCollection = await managerMovies.GetAll(3);//page 1//create command to continue... if (moviesCollection.Results != null) { foreach (Models.MoviesNewClass.Resultado outView in moviesCollection.Results) { var genreIds = outView.Genre_ids;//list id genres of movie in upcoming compare to another list SimilarMovies.Add(new Models.MoviesNewClass.Resultado { Id = outView.Id, Poster_path = "https://image.tmdb.org/t/p/w200" + outView.Poster_path, Title = outView.Title, Release_date = outView.Release_date, //GenresOut = genreOut }); } listaSimilar.ItemsSource = SimilarMovies; } }
private async void ReturnData() { var moviesCollection = await managerMovies.GetAll(1);//page 1//create command to continue... if (moviesCollection.Results != null) { foreach (Models.MoviesNewClass.Resultado outView in moviesCollection.Results) { var genreIds = outView.Genre_ids;//list id genres of movie in upcoming compare to another list ListMovies.Add(new Models.MoviesNewClass.Resultado { Id = outView.Id, Poster_path = "https://image.tmdb.org/t/p/w200" + outView.Poster_path, Title = outView.Title, Release_date = outView.Release_date, //GenresOut = genreOut }); } } }
private async void ReturnData() { var listGenres = await managerMovies.GetAllGenres(); var moviesCollection = await managerMovies.GetAll(1);//page 1//create command to continue... if (moviesCollection.results != null) { foreach (Models.MoviesNewClass.Result outView in moviesCollection.results) { //var id_movie = outView.id;//id movie for detail var genreIds = outView.genre_ids; //list id genres of movie in upcoming compare to another list var genreListAll = listGenres.genres; //lista all genres foreach (var a in genreIds) { int num = a; foreach (var b in genreListAll) { var id = b.id; if (num == id) { genreOut = String.Concat(b.name + ""); } } } //string poster_path_generator = "https://image.tmdb.org/t/p/w200" + outView.poster_path; ListMovies.Add(new Models.MoviesNewClass.Result { id = outView.id, poster_path = "https://image.tmdb.org/t/p/w200" + outView.poster_path, title = outView.title, release_date = outView.release_date, genresOut = genreOut }); } } }