Esempio n. 1
0
        protected virtual void btn_play_Click(object sender, RoutedEventArgs e)
        {
            var item = SelectedSongs.FirstOrDefault() ?? Items.OfType <SongViewModel>().FirstOrDefault();

            if (item == null)
            {
                return;
            }
            var location = item.Song.DownloadState == "complete" ? item.Song.FilePath : item.Song.UrlMp3;

            if (string.IsNullOrEmpty(location))
            {
                return;
            }
            if (Mp3Player.GetPlayOrPause(item.Id))
            {
                if (!PlayList.Contains(item))
                {
                    PlayList.NeedsRefresh();
                    PlayList.Refresh(Items.OfType <SongViewModel>());
                }
                else if (isMultiSelect(this))
                {
                    PlayList.NeedsRefresh();
                    PlayList.Refresh(SelectedSongs);
                }
            }
            Mp3Player.Play(location, item.Id);
            ActionBarService.Refresh();
        }
Esempio n. 2
0
 protected virtual void btn_next_Click(object sender, RoutedEventArgs e)
 {
     PlayList.Refresh(Items.OfType <SongViewModel>());
     Mp3Player.Next();
 }