private async Task RunCurrentStep() { try { CurrentStep.SaveSettings(); Settings.Default.OpenSolutionAfterCreation = OpenSolutionAfterCreation; Settings.Default.Save(); IsWorking = true; var succeeded = await CurrentStep.ExecuteAsync(myProgress, myStepContext); IsWorking = false; if (!succeeded) { StatusText = "Failed."; return; } StatusText = "Ready."; if (NextStep()) { await CurrentStep.OnNavigatedToAsync(myProgress, myStepContext); return; } // last step if (OpenSolutionAfterCreation) { OpenSolution(); } // close dialog after the last step. CloseDialog(); } catch (Exception ex) { var msg = $"An error occured while running step '{CurrentStep?.ActionText ?? "<null>"}'."; theLogger.Error(msg, ex); MessageBox.Show(msg + Environment.NewLine + "Details: " + ex.Message + Environment.NewLine + "See log file for more details: '%AppData%\\ThinkSharp\\Solutions\\error.log''", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }