diff --git a/FModel/Views/Resources/Controls/EndpointEditor.xaml b/FModel/Views/Resources/Controls/EndpointEditor.xaml index 15d89fa8..4b82bb4a 100644 --- a/FModel/Views/Resources/Controls/EndpointEditor.xaml +++ b/FModel/Views/Resources/Controls/EndpointEditor.xaml @@ -6,7 +6,7 @@ xmlns:adonisUi="clr-namespace:AdonisUI;assembly=AdonisUI" xmlns:adonisControls="clr-namespace:AdonisUI.Controls;assembly=AdonisUI" xmlns:adonisExtensions="clr-namespace:AdonisUI.Extensions;assembly=AdonisUI" - WindowStartupLocation="CenterScreen" IconVisibility="Collapsed" ResizeMode="NoResize" Closing="OnClosing" + WindowStartupLocation="CenterScreen" IconVisibility="Collapsed" ResizeMode="NoResize" Width="{Binding Source={x:Static SystemParameters.MaximizedPrimaryScreenWidth}, Converter={converters:RatioConverter}, ConverterParameter='0.50'}" Height="{Binding Source={x:Static SystemParameters.MaximizedPrimaryScreenWidth}, Converter={converters:RatioConverter}, ConverterParameter='0.35'}"> diff --git a/FModel/Views/Resources/Controls/EndpointEditor.xaml.cs b/FModel/Views/Resources/Controls/EndpointEditor.xaml.cs index b44556de..edeb8f61 100644 --- a/FModel/Views/Resources/Controls/EndpointEditor.xaml.cs +++ b/FModel/Views/Resources/Controls/EndpointEditor.xaml.cs @@ -1,5 +1,4 @@ -using System.ComponentModel; -using System.Diagnostics; +using System.Diagnostics; using System.Windows; using System.Windows.Controls; using FModel.Extensions; @@ -53,8 +52,8 @@ public partial class EndpointEditor private void OnClick(object sender, RoutedEventArgs e) { + DialogResult = _isTested && DataContext is FEndpoint { IsValid: true }; Close(); - DialogResult = DataContext is FEndpoint { IsValid: true }; } private async void OnSend(object sender, RoutedEventArgs e) @@ -96,10 +95,5 @@ public partial class EndpointEditor { Process.Start(new ProcessStartInfo { FileName = "https://jsonpath.herokuapp.com/", UseShellExecute = true }); } - - private void OnClosing(object sender, CancelEventArgs e) - { - if (!_isTested) OnTest(null, null); - } }