//Discover a movie public async Task DiscoverMovie() { //API needs %2C for each , between keywords Keyword.Replace(",", "%2C"); //Create service and get series and genre data var service = new MovieService(); var discovered = await service.GetDiscoverMovieAsync(Media, Language, SortDecreasing, IsAdult, Vote, Keyword); var genreList = await service.GetGenres(Media); //Search for the chosen genre; foreach (var item in genreList.genres) { if (Genre == item.name) { ChosenGenre = item; } } //Clear the list DiscoveredMovies so it wont contain old data DiscoveredMovie.Clear(); //Fill up DiscoveredMovies with elements that meet the requirements foreach (var item in discovered.results) { if (item.genre_ids.Contains(ChosenGenre.id)) { DiscoveredMovie.Add((Movie)item); } } NavigationService.Navigate(typeof(MovieListPage), DiscoveredMovie); }
public void NavigateToDetails() { //Get the movie which name is written in the Textbox above the list int movieId = DiscoveredMovie.Where(x => x.title == MovieName).Single().id; NavigationService.Navigate(typeof(MoviePage), movieId); }
public void NavigateToDetailsWithClick(string movieName) { //Get the movie on which the user clicked int movieId = DiscoveredMovie.Where(x => x.title == movieName).Single().id; NavigationService.Navigate(typeof(MoviePage), movieId); }
public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> state) { //Create new service and get movies from a the list of MovieWithGenreIDs- that was needed for tematical search var service = new MovieService(); foreach (Movie item in (ObservableCollection <Movie>)parameter) { DiscoveredMovie.Add(item); } await base.OnNavigatedToAsync(parameter, mode, state); }
public async Task DiscoverTrendingMovie() { //Create service and get data from API var service = new MovieService(); var discovered = await service.GetTrendingMovie(Timer); DiscoveredMovie.Clear(); //Fill up the emptied DiscoveredMovie with elements that meet requirements foreach (var item in discovered.results) { DiscoveredMovie.Add(item); } NavigationService.Navigate(typeof(MovieListPage), DiscoveredMovie); }