Display error message box on UI thread

This commit is contained in:
Stone_Red
2026-01-13 23:23:39 +01:00
parent 92ecd2e93d
commit c4517fb8ac
@@ -221,6 +221,8 @@ public partial class PluginWindow : Window, IPluginWindow
catch (Exception ex)
{
App.Logger.LogError($"\"{PluginMetadata.Name}\" - {ex}", source: "Plugin");
_ = await Dispatcher.InvokeAsync(async () =>
{
Wpf.Ui.Controls.MessageBox messageBox = new Wpf.Ui.Controls.MessageBox
{
Title = $"Error \"{PluginMetadata.Name}\"",
@@ -228,6 +230,7 @@ public partial class PluginWindow : Window, IPluginWindow
CloseButtonText = "Ok"
};
_ = await messageBox.ShowDialogAsync();
});
Exit();
return;
}