Пример #1
0
        public override async void OnNavigatedTo(object navigationParameter, NavigationMode navigationMode, Dictionary<string, object> viewModelState)
        {
            dynamic parameters = navigationParameter;
            var seasonNumber = (int)parameters.season;
            var showId = (int)parameters.showId;
            var episodeNumber = (int)parameters.episode;

            Episode = await traktService.GetEpisodeAsync(showId, seasonNumber, episodeNumber, extended: TraktExtendEnum.FULL_IMAGES);
            Show = await traktService.GetShowAsync(showId, extended: TraktExtendEnum.MIN);

            Number = Episode.Number;
            Title = Episode.Title;
            Overview = Episode.Overview;
            Screen = Episode.Images.Screenshot.Full;
            AirDate = DateTime.Parse(Episode.First_Aired, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal);

            Comments = new ObservableCollection<TraktComment>(await traktService.GetEpisodeCommentsAsync(showId, seasonNumber, episodeNumber));

            try
            {
                Link = await crawlerService.GetLink(Show.Title, Episode.Season, Episode.Number);
            }
            catch
            {

            }
        }
Пример #2
0
        public override async void OnNavigatedTo(object navigationParameter, NavigationMode navigationMode, Dictionary<string, object> viewModelState)
        {
            var showId = (int)navigationParameter;

            Show = await traktService.GetShowAsync(showId, extended: TraktExtendEnum.FULL_IMAGES);

            Title = Show.Title;
            Poster = Show.Images.Poster.Full;
            Overview = Show.Overview;
            Rating = Show.Rating;

            Progress = await traktService.GetShowWatchedProgressAsync(Show.Ids.Trakt, extended: TraktExtendEnum.IMAGES);

            Seasons = new ObservableCollection<TraktSeason>(from season in await traktService.GetSeasonsAsync(Show.Ids.Trakt, extended: TraktExtendEnum.IMAGES)
                                                            orderby season.Number descending
                                                            select season);

            Comments = new ObservableCollection<TraktComment>(await traktService.GetShowCommentsAsync(Show.Ids.Trakt));

            Related = new ObservableCollection<TraktTVShow>(await traktService.GetRelatedShowsAsync(Show.Ids.Trakt, extended: TraktExtendEnum.IMAGES));
        }