private void Pause() { ControlLabel.Text = "Pause"; MyMediaPlayer.Pause(); StatusButton.Icon = new SymbolIcon(Symbol.Play); _isPlaying = false; }
private void ListViewSong_OnDoubleTapped(object sender, DoubleTappedRoutedEventArgs e) { var selectItem = ListViewSong.SelectedItem as Song; MyMediaPlayer.Pause(); if (selectItem != null) { _currentIndex = _songs.IndexOf(selectItem); MyMediaPlayer.Source = new Uri(selectItem.link); SongThumbnail.ImageSource = new BitmapImage(new Uri(selectItem.thumbnail)); Play(); } }
private void SelectSong(object sender, TappedRoutedEventArgs e) { var selectItem = sender as StackPanel; MyMediaPlayer.Pause(); { if (selectItem.Tag is Song currentSong) { _currentIndex = _mysongs.IndexOf(currentSong); MyMediaPlayer.Source = new Uri(currentSong.link); Play(); } } }
private void SelectSong(object sender, TappedRoutedEventArgs e) { var selectItem = sender as TextBlock; MyMediaPlayer.Pause(); if (selectItem != null) { if (selectItem.Tag is Song currentSong) { _currentIndex = _songs.IndexOf(currentSong); MyMediaPlayer.Source = new Uri(currentSong.link); Play(); } } }
private void SelectSong(object sender, TappedRoutedEventArgs e) { var selectItem = sender as StackPanel; MyMediaPlayer.Pause(); if (selectItem != null) { if (selectItem.Tag is Music currentSong) { Debug.WriteLine("Tag of selectItem: " + selectItem.Tag); _currentIndex = listMusic.IndexOf(currentSong); MyMediaPlayer.Source = new Uri(currentSong.link); Play(); } } }
protected override void OnNavigatedFrom(NavigationEventArgs e) { MyMediaPlayer.Pause(); }