示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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;
                }
            }
        }