private async Task OnExportFiles() { this.CancelToken = new CancellationTokenSource(); IsExporting = true; ConsoleOutput.SendStandard("Starting Export"); var exportedProgress = new Progress <ReportMessage>(OnExportProgress); try { await FileExporter.ExportFiles(_dbConnectionString, SqlQuery, FolderPath, this.CancelToken.Token, exportedProgress); ConsoleOutput.SendSuccess("Export finished"); } catch (OperationCanceledException) { Message = "Cancelled"; ConsoleOutput.SendStandard("Export cancelled"); } finally { IsExporting = false; } }