public static ErrorMessageWindow Show(string title, string errorMessage) { var errorWindow = new ErrorMessageWindow(title, errorMessage) { Owner = Application.Current.MainWindow }; errorWindow.ShowDialog(); return(errorWindow); }
private void TestConnectionButton_OnClick(object sender, RoutedEventArgs e) { NetworkSettings.EnableAllSecurityProtocols(); NetworkSettings.IgnoreServerCertificateValidation(); RestConnector.AwaitContinueOnCapturedContext = false; ReadFields(); try { ConnectionCreator.CheckMissingValues(_conDetails); ConnectionCreator.CreateOctaneConnection(_conDetails); ConnectionCreator.CreateTfsConnection(_conDetails); } catch (Exception ex) { //MessageBox.Show(ex.Message, "ALM Octane", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK); ErrorMessageWindow.Show("ALM Octane", ex.Message); return; } Helper.CheckedConnection = true; MessageBox.Show("Connection successfull", "ALM Octane", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK); }