コード例 #1
0
 private void Pause()
 {
     ControlLabel.Text = "Pause";
     MyMediaPlayer.Pause();
     StatusButton.Icon = new SymbolIcon(Symbol.Play);
     _isPlaying        = false;
 }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
ファイル: MySong.xaml.cs プロジェクト: tunglam1302/MusicApp
        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();
                }
            }
        }
コード例 #4
0
        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();
                }
            }
        }
コード例 #5
0
        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();
                }
            }
        }
コード例 #6
0
 protected override void OnNavigatedFrom(NavigationEventArgs e)
 {
     MyMediaPlayer.Pause();
 }