I am creating a windows 10 app. In a onNavigatedTo I am initializing the content where a bunch of async calls are happening in parallel and when I navigate from the page they continue to run. I want to stop all the async calls before I Navigate from the page as I have common resource and these threads are writing into the common resource even after I navigate from the source page. Is there anyway to do this? Sample code:
foreach(StorageFile sf in list)
{
StorageItemThumbnail thumb = await sf.GetThumbnailAsync(ThumbnailMode.ListView, thumbnailResize, ThumbnailOptions.ResizeThumbnail);
//Process the thumbnail and put it in common resouce
}