/// <summary> /// 上一曲 /// </summary> private void LastMusic() { List <MusicItemViewModel> selectedItem = MusicList.Where(i => i.IsSelected == true).ToList(); if (selectedItem.Count > 0) { Playing = selectedItem.First(); int index = MusicList.IndexOf(Playing); if (index >= 1) { Playing.IsSelected = false; Playing = MusicList[--index]; Playing.IsSelected = true; System.Threading.Thread.Sleep(100); PlayMusic(Playing.Music); } else { Playing.IsSelected = false; Playing = MusicList.Last(); Playing.IsSelected = true; System.Threading.Thread.Sleep(100); PlayMusic(Playing.Music); } PlayIcon = new BitmapImage(new Uri("/Image/full_pause.png", UriKind.Relative)); } }