Пример #1
0
        private async Task LoadPodcastsAsync()
        {
            if (!loadedPodcasts)
            {
                var podcasts = await podcastService.GetPodcastsAsync();

                podcasts.ForEach(p => this.podcasts.Add(new PodcastViewModel(p)));
                loadedPodcasts = true;
            }
        }
Пример #2
0
        private async void LoadPodcastsAsync()
        {
            Debug.WriteLine("Loading podcasts...");
            if (!loadedPodcasts)
            {
                var podcasts = await podcastService.GetPodcastsAsync();

                podcasts.ForEach(p => this.podcasts.Add(new PodcastViewModel(p)));
                loadedPodcasts = true;
            }
            Debug.WriteLine("Loaded podcasts");
        }
Пример #3
0
        private async Task LoadEpisodeAsync()
        {
            episodes.Clear();
            var tempEpisodes = new List <EpisodeViewModel>();
            var podcasts     = await podcastService.GetPodcastsAsync();

            foreach (var podcast in podcasts)
            {
                var podcastVm = new PodcastViewModel(podcast);
                tempEpisodes.AddRange(podcastVm.Episodes);
            }
            tempEpisodes = tempEpisodes.OrderBy(ep => ep.Episode.Published).ToList();
            foreach (var episode in tempEpisodes)
            {
                episodes.Add(episode);
            }
        }