Exemplo n.º 1
0
        public override async void OnNavigatedTo(INavigationParameters parameters)
        {
            if (string.IsNullOrWhiteSpace(Preferences.Get("search", string.Empty)))
            {
                AllShows = await graphQL.MovieQuery("allShows", "thumbnail", "title");

                ColViewLayout = new LinearItemsLayout(ItemsLayoutOrientation.Vertical);
            }

            for (int i = 0; i < AllShows.Count; i++)
            {
                AllShows[i].ShowInfoCommand = new DelegateCommand <MovieModel>(async(show) => await ShowPopup(show));
            }
            IsSearchVisible = false;
        }
Exemplo n.º 2
0
        public override async void OnNavigatedTo(INavigationParameters parameters)
        {
            var popular    = graphQL.MovieQuery("popularShows", "thumbnail", "title");
            var action     = graphQL.MovieQuery("actionShows", "thumbnail", "title");
            var comedy     = graphQL.MovieQuery("comedyShows", "thumbnail", "title");
            var comingSoon = graphQL.MovieQuery("comingSoonShows", "thumbnail", "title");
            var allShows   = graphQL.MovieQuery("allShows", "thumbnail", "title");

            await Task.WhenAll(popular, action, comedy, comingSoon, allShows);

            var graphQLQuery = await graphQL.FeaturedMovieQuery("thumbnail", "genre", "title");

            Thumbnail   = graphQLQuery.FeaturedMovieModel.Thumbnail;
            Genres      = string.Join(" • ", graphQLQuery.FeaturedMovieModel.Genre);
            TitleOfShow = graphQLQuery.FeaturedMovieModel.Title;

            Popular    = await popular;
            Action     = await action;
            Comedy     = await comedy;
            ComingSoon = await comingSoon;
            AllShows   = await allShows;

            for (int i = 0; i < Popular.Count; i++)
            {
                Popular[i].ShowInfoCommand = new DelegateCommand <MovieModel>(async(show) => await ShowPopup(show));
            }
            for (int i = 0; i < Action.Count; i++)
            {
                Action[i].ShowInfoCommand = new DelegateCommand <MovieModel>(async(show) => await ShowPopup(show));
            }
            for (int i = 0; i < Comedy.Count; i++)
            {
                Comedy[i].ShowInfoCommand = new DelegateCommand <MovieModel>(async(show) => await ShowPopup(show));
            }
            for (int i = 0; i < ComingSoon.Count; i++)
            {
                ComingSoon[i].ShowInfoCommand = new DelegateCommand <MovieModel>(async(show) => await ShowPopup(show));
            }
            for (int i = 0; i < AllShows.Count; i++)
            {
                AllShows[i].ShowInfoCommand = new DelegateCommand <MovieModel>(async(show) => await ShowPopup(show));
            }
        }
 public override async void Initialize(INavigationParameters parameters) => ComingSoon = await graphQL.MovieQuery("comingSoonShows", "infoThumbnail", "genre", "title", "synopsis");