public SeriesDetailsViewModel(TvDbSeriesRepository repository)
        {
            this.repository = repository;

            if (!IsInDesignMode)
            {
                MessengerInstance.Register <TvDbSeries>(this, s => Series = s);
            }
            else
            {
                Series = new TvDbSeries()
                {
                    Title            = "Futurama",
                    Image            = "http://thetvdb.com/banners/posters/73871-2.jpg",
                    Banner           = "http://thetvdb.com/banners/graphical/121361-g19.jpg",
                    Rating           = 5,
                    AirsTime         = "9 PM",
                    RemindersEnabled = true,
                    NotificationTime = DateTime.Now,
                    AirsDayOfWeek    = 6,
                    Episodes         = new ObservableCollection <TvDbSeriesEpisode>()
                    {
                        new TvDbSeriesEpisode()
                        {
                            Name          = "Episode 1",
                            SeriesNumber  = "1",
                            EpisodeNumber = "1",
                            FirstAired    = DateTime.Today,
                            Description   = "Jack and Chloe have a plan in place to eliminate the terrorist threat before any more attacks rock London. With no time to spare and lives on the line, Jack and Kate pursue crucial leads in an attempt to gain the upper hand on the incredibly intense circumstances. Meanwhile, key players reveal their true colors.",
                            Image         = "http://thetvdb.com/banners/episodes/121361/3254641.jpg"
                        },
                        new TvDbSeriesEpisode()
                        {
                            Name          = "Episode 2",
                            SeriesNumber  = "1",
                            EpisodeNumber = "2",
                            FirstAired    = DateTime.Today.AddDays(2),
                            Description   = "Jack and Chloe have a plan in place to eliminate the terrorist threat before any more attacks rock London. With no time to spare and lives on the line, Jack and Kate pursue crucial leads in an attempt to gain the upper hand on the incredibly intense circumstances. Meanwhile, key players reveal their true colors.",
                            Image         = "http://thetvdb.com/banners/episodes/121361/3254641.jpg"
                        },
                        new TvDbSeriesEpisode()
                        {
                            Name          = "Episode 1",
                            SeriesNumber  = "2",
                            EpisodeNumber = "1",
                            FirstAired    = DateTime.Today,
                            Description   = "Jack and Chloe have a plan in place to eliminate the terrorist threat before any more attacks rock London. With no time to spare and lives on the line, Jack and Kate pursue crucial leads in an attempt to gain the upper hand on the incredibly intense circumstances. Meanwhile, key players reveal their true colors.",
                            Image         = "http://thetvdb.com/banners/episodes/121361/3254641.jpg"
                        }
                    },
                    Overview = @"Chocolate bar macaroon halvah candy cheesecake pie macaroon gummies lemon drops. Soufflé marzipan cake. Wypas tootsie roll candy sweet roll candy soufflé. Sesame snaps topping candy caramels lollipop cheesecake marshmallow.
                                 Cake toffee dessert powder cupcake macaroon dragée faworki cookie. Chupa chups halvah applicake liquorice marzipan carrot cake gummi bears chocolate cake. Sugar plum marshmallow halvah cookie caramels dragée wafer sugar plum sugar plum. Cheesecake macaroon carrot cake topping wafer carrot cake lemon drops."
                };
            }
        }
        public SeriesDetailsViewModel(TvDbSeriesRepository repository)
        {
            this.repository = repository;

            if (!IsInDesignMode)
            {
                MessengerInstance.Register <TvDbSeries>(this, s => Series = s);
            }
            else
            {
                Series = new TvDbSeries()
                {
                    Title            = "Futurama",
                    Image            = "http://thetvdb.com/banners/posters/73871-2.jpg",
                    Banner           = "http://thetvdb.com/banners/graphical/121361-g19.jpg",
                    Rating           = 5,
                    AirsTime         = "9 PM",
                    RemindersEnabled = true,
                    NotificationTime = DateTime.Now,
                    AirsDayOfWeek    = 6,
                    Episodes         = new ObservableCollection <TvDbSeriesEpisode>()
                    {
                        new TvDbSeriesEpisode()
                        {
                            Name          = "Episode 1",
                            SeriesNumber  = "1",
                            EpisodeNumber = "1",
                            Description   = "bla bla bla bla bla lba",
                            Image         = "http://thetvdb.com/banners/episodes/121361/3254641.jpg"
                        },
                        new TvDbSeriesEpisode()
                        {
                            Name          = "Episode 2",
                            SeriesNumber  = "1",
                            EpisodeNumber = "2",
                            FirstAired    = DateTime.Today.AddDays(2),
                            Description   = "bla bla bla bla bla lba",
                            Image         = "http://thetvdb.com/banners/episodes/121361/3254641.jpg"
                        },
                        new TvDbSeriesEpisode()
                        {
                            Name          = "Episode 1",
                            SeriesNumber  = "2",
                            EpisodeNumber = "1",
                            Description   = "bla bla bla bla bla lba",
                            Image         = "http://thetvdb.com/banners/episodes/121361/3254641.jpg"
                        }
                    },
                    Overview = @"Chocolate bar macaroon halvah candy cheesecake pie macaroon gummies lemon drops. Soufflé marzipan cake. Wypas tootsie roll candy sweet roll candy soufflé. Sesame snaps topping candy caramels lollipop cheesecake marshmallow.
                                 Cake toffee dessert powder cupcake macaroon dragée faworki cookie. Chupa chups halvah applicake liquorice marzipan carrot cake gummi bears chocolate cake. Sugar plum marshmallow halvah cookie caramels dragée wafer sugar plum sugar plum. Cheesecake macaroon carrot cake topping wafer carrot cake lemon drops."
                };
            }
        }
예제 #3
0
        public async Task UpdateData(TvDbSeries series)
        {
            if (!await EnsureInitialized())
            {
                return;
            }

            try
            {
                var    url      = string.Format("{0}/api/{1}/series/{2}/all/en.xml", mirror, ApiKey, series.Id);
                var    wc       = new WebClient();
                string response = await wc.DownloadStringTaskAsync(url);

                connectivityService.ReportHealth(true);
                try
                {
                    var updates = await Task.Factory.StartNew(() => GetSeriesUpdates(response).ToList());

                    foreach (var update in updates)
                    {
                        if (update != null)
                        {
                            update(series);
                        }
                    }
                }
                catch (XmlException)
                {
                }
            }
            catch (WebException we)
            {
                connectivityService.ReportHealth(false);
                Console.Out.WriteLine("Error initializing: " + we.Message);
            }
        }