예제 #1
0
        private void PopulatePodCastsFromShow(ShowControl sc)
        {
            if (sc != null)
            {
                _podcasts.Clear();

                List <EpisodeControl> orderedByDateList = null;
                orderedByDateList = sc.Episodes.OrderByDescending(x => x.PublishedDate.Ticks).ToList();

                foreach (EpisodeControl x in orderedByDateList)
                {
                    if (x.Hidden)
                    {
                        continue;
                    }

                    PodcastEpisodeUC pce = new PodcastEpisodeUC();
                    pce.EpisodeControlData = x;
                    pce.ShowName           = sc.Title;
                    _podcasts.Add(pce);
                }

                EpisodesItems.ItemsSource = _podcasts;
            }
        }
예제 #2
0
        private void EpisodesItems_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count == 0)
            {
                return;
            }

            _currentPodcast = e.AddedItems[0] as PodcastEpisodeUC;

            MediaPlayer.Stop();
            MediaPlayer.AutoPlay = true;
            MediaPlayer.Source   = new Uri(_currentPodcast.UrlToPlay);
            MediaPlayer.Position = new TimeSpan(_currentPodcast.PlayedLength);
            _setPlayBackTime     = _currentPodcast.PlayedLength;
            MediaPlayer.Play();

            OnPropertyChanged("PodcastDescription");
        }