From 6bcafc823e836ecd5790f87178a906333699f868 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期四, 10 四月 2025 10:46:47 +0800
Subject: [PATCH] 优化插件结构;
---
HMI.UI/Util/MsgBoxHelper.cs | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/HMI.UI/Util/MsgBoxHelper.cs b/HMI.UI/Util/MsgBoxHelper.cs
index 8a20c3e..6d5d49d 100644
--- a/HMI.UI/Util/MsgBoxHelper.cs
+++ b/HMI.UI/Util/MsgBoxHelper.cs
@@ -8,7 +8,7 @@
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 +48,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,7 +71,7 @@
MessageBoxResult res = MessageBoxResult.None;
if (!(owner is Window window))
{
- window = Window.GetWindow(owner);
+ window = Window.GetWindow(owner) ?? Application.Current.MainWindow;
}
window.Dispatcher.Invoke(() =>
{
--
Gitblit v1.9.1