diff --git a/src/.idea/.idea.Artemis/.idea/avalonia.xml b/src/.idea/.idea.Artemis/.idea/avalonia.xml
index 248ae2e68..33b62dcac 100644
--- a/src/.idea/.idea.Artemis/.idea/avalonia.xml
+++ b/src/.idea/.idea.Artemis/.idea/avalonia.xml
@@ -24,6 +24,7 @@
+
diff --git a/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Windows/BrushConfigurationWindowView.axaml.cs b/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Windows/BrushConfigurationWindowView.axaml.cs
index 42011416c..3016b7d79 100644
--- a/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Windows/BrushConfigurationWindowView.axaml.cs
+++ b/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Windows/BrushConfigurationWindowView.axaml.cs
@@ -4,7 +4,7 @@ using Avalonia.Markup.Xaml;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Windows;
-public class BrushConfigurationWindowView : ReactiveCoreWindow
+public class BrushConfigurationWindowView : ReactiveCoreWindow
{
public BrushConfigurationWindowView()
{
@@ -20,8 +20,11 @@ public class BrushConfigurationWindowView : ReactiveCoreWindow
public BrushConfigurationViewModel ConfigurationViewModel { get; }
public LayerBrushConfigurationDialog Configuration { get; }
- public bool CanClose()
+ public async Task CanClose()
{
- return ConfigurationViewModel.CanClose() && Dispatcher.UIThread.InvokeAsync(async () => await ConfigurationViewModel.CanCloseAsync()).GetAwaiter().GetResult();
+ // ReSharper disable once MethodHasAsyncOverload - Checking both in case the plugin developer only implemented CanClose
+ return ConfigurationViewModel.CanClose() && await ConfigurationViewModel.CanCloseAsync();
}
- private void ConfigurationViewModelOnCloseRequested(object? sender, EventArgs e)
+ private async void ConfigurationViewModelOnCloseRequested(object? sender, EventArgs e)
{
- if (CanClose())
+ if (await CanClose())
Close(null);
}
}
\ No newline at end of file
diff --git a/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Windows/EffectConfigurationWindowView.axaml.cs b/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Windows/EffectConfigurationWindowView.axaml.cs
index 8f1683152..eb1fbc70f 100644
--- a/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Windows/EffectConfigurationWindowView.axaml.cs
+++ b/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Windows/EffectConfigurationWindowView.axaml.cs
@@ -20,8 +20,11 @@ public class EffectConfigurationWindowView : ReactiveCoreWindow
public EffectConfigurationViewModel ConfigurationViewModel { get; }
public LayerEffectConfigurationDialog Configuration { get; }
- public bool CanClose()
+ public async Task CanClose()
{
- return ConfigurationViewModel.CanClose() && Dispatcher.UIThread.InvokeAsync(async () => await ConfigurationViewModel.CanCloseAsync()).GetAwaiter().GetResult();
+ // ReSharper disable once MethodHasAsyncOverload - Checking both in case the plugin developer only implemented CanClose
+ return ConfigurationViewModel.CanClose() && await ConfigurationViewModel.CanCloseAsync();
}
- private void ConfigurationViewModelOnCloseRequested(object? sender, EventArgs e)
+ private async void ConfigurationViewModelOnCloseRequested(object? sender, EventArgs e)
{
- if (CanClose())
+ if (await CanClose())
Close(null);
}
}
\ No newline at end of file