private List<Show> AcquireShows()
        {
            var shows = new List<Show>();

            // Fake data

            var showsToGenerate = this._rand.Next(50, 100);

            for (var i = 0; i < showsToGenerate; i++)
            {
                var show = new Show();

                // Generate show

                shows.Add(show);
            }

            return shows;
        }
        public MainPageViewModel()
        {
            this.FeaturedShows = new ObservableCollection<Show>();
            this.NewReleaseShows = new ObservableCollection<Show>();
            this.SciFiShows = new ObservableCollection<Show>();

            this.OnShowItemClickedCommand = new RelayCommand<Show>(this.OnShowItemClicked);

            if (Windows.ApplicationModel.DesignMode.DesignModeEnabled)
            {
                var show = new Show
                {
                    Title = "Hello World",
                    Rating = 4,
                    Genre = Genre.SciFi,
                    HeroImage = "ms-appx:///Assets/TVShowImages/Rocks.jpg",
                    Image = "ms-appx:///Assets/TVShowImages/Rocks.jpg",
                    ReleaseDate = DateTime.Now
                };

                show.Seasons.Add(new Season { Number = 1, ReleaseDate = DateTime.Now });

                this.FeaturedShows.Add(show);
                this.FeaturedShows.Add(show);
                this.FeaturedShows.Add(show);

                this.NewReleaseShows.Add(show);
                this.NewReleaseShows.Add(show);
                this.NewReleaseShows.Add(show);

                this.NewReleasesVisible = true;

                this.SciFiShows.Add(show);
                this.SciFiShows.Add(show);
                this.SciFiShows.Add(show);

                this.SciFiVisible = true;
            }
        }
 private void OnShowItemClicked(Show obj)
 {
     // ToDo
 }
Esempio n. 4
0
        private List<Show> AcquireShows()
        {
            var shows = new List<Show>();

            // Fake data

            var showsToGenerate = this._rand.Next(50, 100);

            for (var i = 0; i < showsToGenerate; i++)
            {
                var show = new Show
                               {
                                   Title = this.GenerateShowTitle(),
                                   Genre = this.GenerateShowGenre(),
                                   Rating = (double)this._rand.Next(0, 50) / 10,
                                   HeroImage = this._tvShowImages[this._rand.Next(this._tvShowImages.Count)],
                                   Image = this._tvShowImages[this._rand.Next(this._tvShowImages.Count)]
                               };

                show.Cast.AddRange(this.GenerateShowCast());

                show.Seasons.AddRange(this.GenerateShowSeasons());

                shows.Add(show);
            }

            return shows;
        }