private async void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { var d = args.GetDeferral(); var tasks = new List <Task <StorageFile> >(); StorageFolder folder; try { if (!Settings.Current.DownloadPathToken.IsNullorEmpty()) { folder = await Windows.Storage.AccessCache.StorageApplicationPermissions. FutureAccessList.GetFolderAsync(Settings.Current.DownloadPathToken); } else { var lib = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Music); folder = await lib.SaveFolder.CreateFolderAsync("Download", CreationCollisionOption.OpenIfExists); } } catch (Exception) { var lib = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Music); folder = await lib.SaveFolder.CreateFolderAsync("Download", CreationCollisionOption.OpenIfExists); } MainPage.Current.PopMessage(SmartFormat.Smart.Format("Starting download {0} {0:song|songs}", SongList.Count)); foreach (var item in SongList) { var t = Task.Run(async() => { var res = await FileTracker.DownloadMusic(item.Song, folder); await FileTracker.AddTags(res, item.Song); }); } d.Complete(); }