private void Panel_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { NewsFeedViewModel viewModel = (NewsFeedViewModel)this.DataContext; if (viewModel != null && viewModel.NewsItems.Any()) { NewsFeedItem newsFeedItem = viewModel.GetCurrentNewsFeedItem(); this.WebBrowserControl.Navigate(newsFeedItem.Album.ExternalUrls["spotify"]); } SetNotificationText(string.Empty); }
private void OnRightButtonClick(object sender, RoutedEventArgs e) { NewsFeedViewModel viewModel = (NewsFeedViewModel)this.DataContext; if (viewModel.NewsItems.Any()) { NewsFeedItem newsFeedItem = viewModel.GetNextNewsFeedItem(); this.WebBrowserControl.Navigate(newsFeedItem.Album.ExternalUrls["spotify"]); } SetNotificationText(string.Empty); }
private void OnAddToPlaylistClick(object sender, RoutedEventArgs e) { NewsFeedViewModel viewModel = (NewsFeedViewModel)this.DataContext; if (viewModel != null) { NewsFeedItem newsFeedItem = viewModel.GetCurrentNewsFeedItem(); if (!newsFeedItem.Added) { AddToPlaylistEventArgs eventArgs = new AddToPlaylistEventArgs(AddToPlaylistEvent, newsFeedItem.Album); RaiseEvent(eventArgs); newsFeedItem.Added = true; } } }