mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-04 00:46:12 +02:00
Display error message box on UI thread
This commit is contained in:
@@ -221,6 +221,8 @@ public partial class PluginWindow : Window, IPluginWindow
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
App.Logger.LogError($"\"{PluginMetadata.Name}\" - {ex}", source: "Plugin");
|
App.Logger.LogError($"\"{PluginMetadata.Name}\" - {ex}", source: "Plugin");
|
||||||
|
_ = await Dispatcher.InvokeAsync(async () =>
|
||||||
|
{
|
||||||
Wpf.Ui.Controls.MessageBox messageBox = new Wpf.Ui.Controls.MessageBox
|
Wpf.Ui.Controls.MessageBox messageBox = new Wpf.Ui.Controls.MessageBox
|
||||||
{
|
{
|
||||||
Title = $"Error \"{PluginMetadata.Name}\"",
|
Title = $"Error \"{PluginMetadata.Name}\"",
|
||||||
@@ -228,6 +230,7 @@ public partial class PluginWindow : Window, IPluginWindow
|
|||||||
CloseButtonText = "Ok"
|
CloseButtonText = "Ok"
|
||||||
};
|
};
|
||||||
_ = await messageBox.ShowDialogAsync();
|
_ = await messageBox.ShowDialogAsync();
|
||||||
|
});
|
||||||
Exit();
|
Exit();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user