From 3a471ae651b228231bebb3a2d438baa1d4ac0261 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期五, 21 十一月 2025 08:57:52 +0800
Subject: [PATCH] 优化

---
 HMI.UI/MaskWindow.xaml.cs |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/HMI.UI/MaskWindow.xaml.cs b/HMI.UI/MaskWindow.xaml.cs
index 56fd10e..0298727 100644
--- a/HMI.UI/MaskWindow.xaml.cs
+++ b/HMI.UI/MaskWindow.xaml.cs
@@ -50,9 +50,19 @@
             //}));
             Task.Run(() =>
             {
-                // 鏆傚仠绾跨▼浠I瀹屽叏灞曠ず
-                if (delay > 0) Thread.Sleep(delay);
-                action(this);
+                try
+                {
+                    // 鏆傚仠绾跨▼浠I瀹屽叏灞曠ず
+                    if (delay > 0) Thread.Sleep(delay);
+                    action(this);
+                }
+                finally
+                {
+                    Dispatcher.Invoke(() =>
+                    {
+                        this.Close();
+                    });
+                }
             });
         }
 

--
Gitblit v1.9.1