From 2e889843b4c171f2d6ad8e0d53084040703d11f6 Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 09 十一月 2026 13:18:21 +0800
Subject: [PATCH] docs: CAN 总线级应答器 + 硬件调试页多标签多会话 设计规格
---
HMI.UI/Util/MsgBoxHelper.cs | 23 +++++++++++++++++------
1 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/HMI.UI/Util/MsgBoxHelper.cs b/HMI.UI/Util/MsgBoxHelper.cs
index 8a20c3e..2c81478 100644
--- a/HMI.UI/Util/MsgBoxHelper.cs
+++ b/HMI.UI/Util/MsgBoxHelper.cs
@@ -2,13 +2,14 @@
using System.Windows;
using Panuon.WPF.UI.Configurations;
using HMI.Core.Util;
+using System;
namespace HMI.UI.Util
{
public class MsgBoxHelper
{
#region Warn
- public static MessageBoxResult WarnMessage(Window owner,
+ public static MessageBoxResult WarnMessage(DependencyObject owner,
string message,
string caption = null,
MessageBoxButton button = MessageBoxButton.OKCancel,
@@ -48,7 +49,7 @@
#endregion
#region Info
- public static MessageBoxResult InfoMessage(Window owner,
+ public static MessageBoxResult InfoMessage(DependencyObject owner,
string message,
string caption = null,
MessageBoxButton button = MessageBoxButton.OKCancel,
@@ -71,12 +72,22 @@
MessageBoxResult res = MessageBoxResult.None;
if (!(owner is Window window))
{
- window = Window.GetWindow(owner);
+ 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