// Events need to have void return type, they cannot have Task as a return type. This is the one exception that C# knows about.
        private async void ExecuteAsync_Click(object sender, RoutedEventArgs e)
        {
            Progress <ProgressReportModel> progress = new Progress <ProgressReportModel>();

            progress.ProgressChanged += ReportProgress;

            var watch = System.Diagnostics.Stopwatch.StartNew();

            /*
             *  ThrowIfCancellationRequested will throw an exception. So it's important to wrap our call in try/catch block.
             */
            try
            {
                var results = await DemoMethod.RunDownloadAsync(progress, cts.Token);

                PrintResults(results);
            }
            catch (OperationCanceledException)
            {
                resultsWindow.Text += $"The async downloaded was cancelled { Environment.NewLine }";
            }

            watch.Stop();
            var elapsedMs = watch.ElapsedMilliseconds;

            resultsWindow.Text += $"Total execution time: { elapsedMs }";
        }
        private void ExecuteSync_Click(object sender, RoutedEventArgs e)
        {
            var watch = System.Diagnostics.Stopwatch.StartNew();

            //var results = DemoMethod.RunDownloadSync();
            var results = DemoMethod.RunDownloadParallelSync();

            PrintResults(results);

            watch.Stop();
            var elapsedMs = watch.ElapsedMilliseconds;

            resultsWindow.Text += $"Total execution time: { elapsedMs }";
        }
        private async void ExecuteParallelAsync_Click(object sender, RoutedEventArgs e)
        {
            Progress <ProgressReportModel> progress = new Progress <ProgressReportModel>();

            progress.ProgressChanged += ReportProgress;

            var watch = System.Diagnostics.Stopwatch.StartNew();

            var results = await DemoMethod.RunDownloadParallelAsyncV2(progress);

            PrintResults(results);

            watch.Stop();
            var elapsedMs = watch.ElapsedMilliseconds;

            resultsWindow.Text += $"Total execution time: { elapsedMs }";
        }