Exemple #1
0
        protected async override void OnAppearing()
        {
            try
            {
                DA = new DashBoardModel();

                if (await DA.LastMovieUploaded(NItems) > 0)
                {
                    //Movies = DA.Movies.Select(n => new MovieCarousel(n) { position = Movies.Count }).ToList();
                    //carouselLast.ItemsSource = Movies;
                    Movies = DA.Movies;
                    HorListLastAdded.ItemsSource = Movies;
                }
                else
                {
                    WelcomeMessage1.IsVisible = true;
                    WelcomeMessage2.IsVisible = true;
                    TitleLastAdd.IsVisible    = false;
                    TitleLastSaw.IsVisible    = false;
                    TitleBestRating.IsVisible = false;
                    TitleTvLastSeen.IsVisible = false;
                }

                if (await DA.LastMovieSeen(NItems) > 0)
                {
                    //Movies = DA.Movies.Select(n => new MovieCarousel(n) { position = Movies.Count }).ToList();
                    //carouselSeen.ItemsSource = Movies;
                    Movies = DA.Movies;
                    HorListLastSeen.ItemsSource = Movies;
                }

                if (await DA.BestRatedMovie(NItems) > 0)
                {
                    //Movies = DA.Movies.Select(n => new MovieCarousel(n) { position = Movies.Count }).ToList();
                    //carouselBest.ItemsSource = Movies;
                    Movies = DA.Movies;
                    HorListBestRating.ItemsSource = Movies;
                }

                if (await DA.LastTvShowSeen(NItems) > 0)
                {
                    //Movies = DA.Movies.Select(n => new MovieCarousel(n) { position = Movies.Count }).ToList();
                    //carouselSeen.ItemsSource = Movies;
                    TvShows = DA.TvShows;
                    HorListTvLastSeen.ItemsSource = TvShows;
                }
            }
            catch (Exception ex)
            {
                Crashes.TrackError(ex);
                throw ex;
            }
        }
        protected async override void OnAppearing()
        {
            try
            {
                DA = new DashBoardModel();

                await DA.LastMovieUploaded(NItems);

                //Movies = DA.Movies.Select(n => new MovieCarousel(n) { position = Movies.Count }).ToList();
                //carouselLast.ItemsSource = Movies;
                Movies = DA.Movies;
                HorListLastAdded.ItemsSource = Movies;

                if (Movies.Count == 0)
                {
                    WelcomeMessage1.IsVisible = true;
                    WelcomeMessage2.IsVisible = true;
                    TitleLastAdd.IsVisible    = false;
                    TitleLastSaw.IsVisible    = false;
                    TitleBestRating.IsVisible = false;
                }

                await DA.LastMovieSeen(NItems);

                //Movies = DA.Movies.Select(n => new MovieCarousel(n) { position = Movies.Count }).ToList();
                //carouselSeen.ItemsSource = Movies;
                Movies = DA.Movies;
                HorListLastSeen.ItemsSource = Movies;

                await DA.BestRatedMovie(NItems);

                //Movies = DA.Movies.Select(n => new MovieCarousel(n) { position = Movies.Count }).ToList();
                //carouselBest.ItemsSource = Movies;
                Movies = DA.Movies;
                HorListBestRating.ItemsSource = Movies;
            }
            catch (Exception e)
            { throw e; }
        }