public override async void Initialize(INavigationParameters parameters) { var passedParameter = parameters.GetValue <MovieModel>("show"); var episodePageQuery = await graphQL.SearchForShow(passedParameter.Title, "casts", "infoThumbnail"); TitleOfShow = passedParameter.Title; Year = passedParameter.Year; Synopsis = passedParameter.Synopsis; Thumbnail = passedParameter.Thumbnail; Casts = episodePageQuery.SearchForShowModel.Casts; InfoThumbnail = episodePageQuery.SearchForShowModel.InfoThumbnail; var episodes = new ObservableCollection <MovieModel>(); for (int i = 1; i < 11; i++) { var episodesToAdd = new MovieModel { InfoThumbnail = InfoThumbnail, EpisodeNumber = i, }; episodes.Add(episodesToAdd); } Episodes = new ObservableCollection <MovieModel>(episodes); }
public override async void OnNavigatedTo(INavigationParameters parameters) { var passedParameter = parameters.GetValue <MovieModel>("show"); var featuredMoviePopup = await graphQL.SearchForShow(passedParameter.Title, "year", "synopsis", "casts"); Year = featuredMoviePopup.SearchForShowModel.Year; Synopsis = featuredMoviePopup.SearchForShowModel.Synopsis; Thumbnail = passedParameter.Thumbnail; Title = passedParameter.Title; }
private async Task AddtoList() { await App.CreateDatabaseTable <MovieModel>().ConfigureAwait(false); var myListPageQuery = await graphQL.SearchForShow(TitleOfShow, "year", "synopsis", "casts"); var listItem = new MovieModel { Title = TitleOfShow, Year = myListPageQuery.SearchForShowModel.Year, Synopsis = myListPageQuery.SearchForShowModel.Synopsis, Casts = myListPageQuery.SearchForShowModel.Casts, Thumbnail = Thumbnail }; Device.BeginInvokeOnMainThread(() => { toast.ShowToast("Succesfully added to your list"); }); await App.ConnectionString.InsertAsync(listItem).ConfigureAwait(false); }