From 0940f31b7eba1cf6b6a8c1fca72d97cf686e79f2 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期五, 04 七月 2025 10:43:00 +0800
Subject: [PATCH] 优化插件,完善TreeListView
---
HMI.UI/Util/MsgBoxHelper.cs | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/HMI.UI/Util/MsgBoxHelper.cs b/HMI.UI/Util/MsgBoxHelper.cs
index 6d5d49d..18f2a30 100644
--- a/HMI.UI/Util/MsgBoxHelper.cs
+++ b/HMI.UI/Util/MsgBoxHelper.cs
@@ -71,12 +71,22 @@
MessageBoxResult res = MessageBoxResult.None;
if (!(owner is Window window))
{
- window = Window.GetWindow(owner) ?? Application.Current.MainWindow;
+ owner.Dispatcher.Invoke(() =>
+ {
+ window = Window.GetWindow(owner) ?? Application.Current.MainWindow;
+ window.Dispatcher.Invoke(() =>
+ {
+ res = MessageBoxX.Show(window, message, caption, button, icon, defaultButton, setting, countdown);
+ });
+ });
}
- window.Dispatcher.Invoke(() =>
+ else
{
- res = MessageBoxX.Show(window, message, caption, button, icon, defaultButton, setting, countdown);
- });
+ window.Dispatcher.Invoke(() =>
+ {
+ res = MessageBoxX.Show(window, message, caption, button, icon, defaultButton, setting, countdown);
+ });
+ }
return res;
}
}
--
Gitblit v1.9.1