public void AddSong(LuoVolSong item) { if (!IsHeartedSong(item)) { HeartSongs.Add(item); } }
private async void ListView_ItemClick_1(object sender, ItemClickEventArgs e) { LuoVolSong item = (LuoVolSong)e.ClickedItem; //MainVM.CurrentSong = item; //Player.Source=MediaSource.CreateFromUri(new Uri(item.SongUrl)); await MainVM.InstantPlayAsync(MainVM.CurrentVol.Vol.VolSongs, MainVM.CurrentVol.Vol.VolSongs.IndexOf(item)); }
private async void ListView_ItemClick_1(object sender, ItemClickEventArgs e) { LuoVolSong item = (LuoVolSong)e.ClickedItem; if (MainVM.CurrentSong == item) { if (MainVM.IsPlaying) { MainVM.player.Pause(); } else { MainVM.player.Play(); } } else { await MainVM.InstantPlayAsync(MainVM.CurrentPlayVol.Vol.VolSongs, MainVM.CurrentPlayVol.Vol.VolSongs.IndexOf(item)); } }
private async void ListView_ItemClick_1(object sender, ItemClickEventArgs e) { LuoVolSong item = (LuoVolSong)e.ClickedItem; //MainVM.CurrentSong = item; //Player.Source=MediaSource.CreateFromUri(new Uri(item.SongUrl)); if ((MainVM.CurrentPlayVol == MainVM.CurrentVol) && (MainVM.CurrentSong == item)) { if (MainVM.IsPlaying) { MainVM.player.Pause(); } else { MainVM.player.Play(); } } else { MainVM.CurrentPlayVol = MainVM.CurrentVol; await MainVM.InstantPlayAsync(MainVM.CurrentVol.Vol.VolSongs, MainVM.CurrentVol.Vol.VolSongs.IndexOf(item)); } }
public void RemoveSong(LuoVolSong item) { HeartSongs.Remove(item); }
public bool IsHeartedSong(LuoVolSong item) { return(HeartSongs.Any(p => p.Name == item.Name)); }