Exemplo n.º 1
0
 private void Pause()
 {
     ControlLabel.Text = "Pause";
     MyMediaPlayer1.Pause();
     StatusButton.Icon = new SymbolIcon(Symbol.Play);
     _isPlaying        = false;
 }
Exemplo n.º 2
0
        private void Play()
        {
            MyMediaPlayer1.Source      = new Uri(_mySongs[_currentIndex].link);
            ControlLabel.Text          = "Now Playing " + _mySongs[_currentIndex].name;
            ListViewSong.SelectedIndex = _currentIndex;

            MyMediaPlayer1.Play();
            StatusButton.Icon = new SymbolIcon(Symbol.Pause);
            _isPlaying        = true;
        }
Exemplo n.º 3
0
        private void SelectSong(object sender, TappedRoutedEventArgs e)
        {
            var selectItem = sender as StackPanel;

            MyMediaPlayer1.Pause();
            if (selectItem != null)
            {
                if (selectItem.Tag is Song currentSong)
                {
                    _currentIndex         = _mySongs.IndexOf(currentSong);
                    MyMediaPlayer1.Source = new Uri(currentSong.link);
                    Play();
                }
            }
        }
Exemplo n.º 4
0
 protected override void OnNavigatedFrom(NavigationEventArgs e)
 {
     MyMediaPlayer1.Pause();
 }