public MainView() { InitializeComponent(); this.DataContext = App.mainViewModels; // Hook to the event when the download list changes, so we can update the pivot header text for the // download page. ((INotifyCollectionChanged)EpisodeDownloadList.Items).CollectionChanged += downloadListChanged; // Upon startup, refresh all subscriptions so we get the latest episodes for each. m_subscriptionsManager = PodcastSubscriptionsManager.getInstance(); m_subscriptionsManager.OnPodcastSubscriptionsChanged += new SubscriptionManagerHandler(m_subscriptionsManager_OnPodcastSubscriptionsChanged); m_subscriptionsManager.refreshSubscriptions(); // Hook to SkyDrive export events m_subscriptionsManager.OnOPMLExportToSkydriveChanged += new SubscriptionManagerHandler(m_subscriptionsManager_OnOPMLExportToSkydriveChanged); m_applicationSettings = IsolatedStorageSettings.ApplicationSettings; // Hook to the event when the podcast player starts playing. m_playbackManager = PodcastPlaybackManager.getInstance(); m_playbackManager.OnOpenPodcastPlayer += new EventHandler(PodcastPlayer_PodcastPlayerStarted); PodcastSubscriptionsManager.getInstance().OnPodcastChannelDeleteStarted += new SubscriptionManagerHandler(subscriptionManager_OnPodcastChannelDeleteStarted); PodcastSubscriptionsManager.getInstance().OnPodcastChannelDeleteFinished += new SubscriptionManagerHandler(subscriptionManager_OnPodcastChannelDeleteFinished); PodcastSubscriptionsManager.getInstance().OnPodcastChannelPlayedCountChanged += new SubscriptionChangedHandler(subscriptionManager_OnPodcastChannelPlayedCountChanged); PodcastSubscriptionsManager.getInstance().OnPodcastChannelAdded += new SubscriptionChangedHandler(subscriptionManager_OnPodcastChannelAdded); PodcastSubscriptionsManager.getInstance().OnPodcastChannelRemoved += new SubscriptionChangedHandler(subscriptionManager_OnPodcastChannelRemoved); SubscriptionsList.ItemsSource = m_subscriptions; if (m_subscriptions.Count > 0) { NoSubscriptionsLabel.Visibility = Visibility.Collapsed; } else { NoSubscriptionsLabel.Visibility = Visibility.Visible; } handleShowReviewPopup(); // This is the earliest place that we can initialize the download manager so it can show the error toast // which is defined in App. App.episodeDownloadManager = PodcastEpisodesDownloadManager.getInstance(); }
public MainView() { InitializeComponent(); // Upon startup, refresh all subscriptions so we get the latest episodes for each. m_subscriptionsManager = PodcastSubscriptionsManager.getInstance(); m_subscriptionsManager.OnPodcastSubscriptionsChanged += new SubscriptionManagerHandler(m_subscriptionsManager_OnPodcastSubscriptionsChanged); m_subscriptionsManager.refreshSubscriptions(); // Post-pageinitialization event call hookup. this.Loaded += new RoutedEventHandler(MainPage_Loaded); // Hook to the event when the download list changes, so we can update the pivot header text for the // download page. ((INotifyCollectionChanged)EpisodeDownloadList.Items).CollectionChanged += downloadListChanged; // Hook to the event when the podcast player starts playing. this.PodcastPlayer.PodcastPlayerStarted += new EventHandler(PodcastPlayer_PodcastPlayerStarted); this.PodcastPlayer.PodcastPlayerStopped += new EventHandler(PodcastPlayer_PodcastPlayerStopped); }
private void SubscriptionsList_RefreshRequested(object sender, EventArgs e) { m_subscriptionsManager.refreshSubscriptions(); }