In my windows store app I am using BackgroundDownloader class to handle multiple background downloads. After all my 3 downloads are 100% complete, I close and open applicati
You have to execute the completion handler by doing AttachAsync()
on the downloads that just completed. After that, downloads will not appear anymore in the results of GetCurrentDownloadsAsync()
.
Try:
private async void Foo()
{
var downloads = await BackgroundDownloader.GetCurrentDownloadsAsync();
foreach (var download in downloads)
{
var task = download.AttachAsync().AsTask();
var notAwait = task.ContinueWith(OnCompleted);
}
}
private void OnCompleted(Task<DownloadOperation> task)
{
DownloadOperation download = task.Result;
// ...
}