private async void MenuFlyoutCollection_Click(object sender, RoutedEventArgs e) { if (SongFlyout.Target is SelectorItem s) { AddPlayList dialog; switch (s.Content) { case GenericMusicItemViewModel g: dialog = new AddPlayList((await g.GetSongsAsync()).Select(x => x.ID)); break; case SongViewModel song: dialog = new AddPlayList(song.ID); break; case AlbumViewModel album: dialog = new AddPlayList((await album.GetSongsAsync()).Select(x => x.ID)); break; case ArtistViewModel artist: dialog = new AddPlayList((await artist.GetSongsAsync()).Select(x => x.ID)); break; default: throw new OperationCanceledException(); } await dialog.ShowAsync(); } }
private async void AddCollectionAppBarButton_Click(object sender, RoutedEventArgs e) { var s = new AddPlayList(AlbumList.SelectedItems.Select(a => (a as SongViewModel).ID).ToList()); await s.ShowAsync(); }