From 1afe548ac40cc7f975917ef9bf2e156595cf81f3 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期四, 16 四月 2026 08:58:04 +0800
Subject: [PATCH] 优化;

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

diff --git a/HMI.UI/MaskWindow.xaml.cs b/HMI.UI/MaskWindow.xaml.cs
index f5d1231..0298727 100644
--- a/HMI.UI/MaskWindow.xaml.cs
+++ b/HMI.UI/MaskWindow.xaml.cs
@@ -42,11 +42,27 @@
 
         private void MaskWindow_ContentRendered(object sender, EventArgs e)
         {
+            //Dispatcher.InvokeAsync(new Action(() =>
+            //{
+            //    鏆傚仠绾跨▼浠I瀹屽叏灞曠ず
+            //    if (delay > 0) Thread.Sleep(delay);
+            //    action(this);
+            //}));
             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