Exemple #1
0
        private async Task DownloadFile(Uri fileLocation, string filePath)
        {
            using (client = new WebClient())
            {
                client.DownloadProgressChanged += (o, e) =>
                {
                    controller.UpdateProgress(e.ProgressPercentage);
                };
                client.DownloadFileCompleted += (o, e) =>
                {
                    if (e.Cancelled)
                    {
                        Debug.WriteLine("DOWNLOAD CANCELED");
                    }
                };

                await client.DownloadFileTaskAsync(fileLocation, filePath);
            }
        }