public static void SafeClose(this IWizardShell shell) { try { (shell as Window)?.Close(); } catch (Exception) { } }
private UserSelection StartWizard(IWizardShell wizardShell, WizardTypeEnum wizardType) { try { CleanStatusBar(); var userSelection = LaunchWizardShell(wizardShell); SendTelemetry(wizardType, userSelection); if (userSelection != null) { return(userSelection); } } catch (Exception ex) when(!(ex is WizardBackoutException)) { (wizardShell as IWindow).SafeClose(); _dialogService.ShowError(ex); } CancelWizard(); return(null); }
private UserSelection LaunchWizardShell(IWizardShell wizardShell) { GenContext.ToolBox.Shell.ShowModal(wizardShell as IWindow); return(wizardShell.Result); }