private void FileOpen() { var filename = _openFileDialogService.Show(); if (!string.IsNullOrEmpty(filename)) { _applicationState.ExcelFilename = filename; RunCloudCommand.RaiseCanExecuteChanged(); } }
private void DoWork(object state) { var cancellationToken = ((CancellationTokenSource)state).Token; // Execute the process steps var step1 = new ExecuteExcelToCsvProcessStep(_eventAggregator, _logger, 1); step1.Run(cancellationToken); var step2 = new ExecuteCreateZipFileProcessStep(_eventAggregator, _logger, 2); step2.Run(cancellationToken); // Update the UI command state Dispatcher.CurrentDispatcher.Invoke(() => { _isRunning = false; RunCloudCommand.RaiseCanExecuteChanged(); CancelCommand.RaiseCanExecuteChanged(); FileOpenCommand.RaiseCanExecuteChanged(); }); }