//share private void ShareClick(object sender, RoutedEventArgs e) { ShareSongHelper.ShareSong(new List <Song>() { _song }); }
public static void Share(List <Song> songs) { if (songs.Count == 0) { ToastManager.ShowError("Unable to share file."); return; } App.Locator.PBar.IsEnable = true; ShareSongHelper.ShareSong(songs); App.Locator.PBar.IsEnable = false; }
private void ShareClickExecute(BaseEntry item) { try { List <Song> shareSongs = null; if (item is Song) { var song = item as Song; if (song.IsDownload) { Core.WinRt.Common.ToastManager.ShowError("Unable to share file."); return; } shareSongs = new List <Song>() { song }; } else if (item is Video) { ShareSongHelper.ShareVideo(item as Video); return; } else if (item is Artist) { var artist = item as Artist; shareSongs = artist.Songs.Where(p => (!p.IsDownload && !p.IsTemp)).ToList(); } else if (item is Album) { var album = item as Album; shareSongs = album.Songs.Where(p => (!p.IsDownload && !p.IsTemp)).ToList(); } else if (item is Playlist) { var playlist = item as Playlist; shareSongs = playlist.Songs.Select(p => p.Song).Where(q => (!q.IsDownload && !q.IsTemp)).ToList(); } if (shareSongs != null && shareSongs.Count > 0) { ShareSongHelper.ShareSong(shareSongs); } } catch (Exception) { } }