示例#1
0
 public DetailViewModel(
     Podcast podcast,
     Func<Episode, EpisodeViewModel> newEpisodeViewModel)
 {
     _podcast = podcast;
     _newEpisodeViewModel = newEpisodeViewModel;
 }
示例#2
0
 private async Task LoadPodcastAsync(Podcast podcast)
 {
     ImmutableList<Episode> episodes;
     episodes = await LoadEpisodesFromCache(podcast.FeedUrl);
     podcast.SetEpisodes(episodes);
     episodes = await LoadEpisodesFromServerAsync(podcast.FeedUrl);
     podcast.SetEpisodes(episodes);
     await SaveEpisodesToCache(podcast.FeedUrl, episodes);
 }
示例#3
0
 public void BeginLoadPodcast(Podcast podcast)
 {
     Perform(() => LoadPodcastAsync(podcast));
 }
示例#4
0
 private Podcast CreatePodcast(SearchResult searchResult)
 {
     var podcast = new Podcast
     {
         Title = searchResult.Title,
         Subtitle = searchResult.Subtitle,
         Author = searchResult.Author,
         FeedUrl = searchResult.FeedUrl,
         ImageUri = searchResult.ImageUri
     };
     _podcastService.BeginLoadPodcast(podcast);
     return podcast;
 }