From 9d1660270272180cd71147d6ddd53d1382643d2e Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 18:00:14 +0800
Subject: [PATCH] merge: 并入远程 Initial commit 作为历史根节点

---
 HMI.UI/MaskWindow.xaml.cs |   74 +++++++++++++++++++++++++++++++++++++
 1 files changed, 74 insertions(+), 0 deletions(-)

diff --git a/HMI.UI/MaskWindow.xaml.cs b/HMI.UI/MaskWindow.xaml.cs
new file mode 100644
index 0000000..0298727
--- /dev/null
+++ b/HMI.UI/MaskWindow.xaml.cs
@@ -0,0 +1,74 @@
+锘縰sing Panuon.WPF.UI;
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace HMI.UI
+{
+    /// <summary>
+    /// MaskWindow.xaml 鐨勪氦浜掗�昏緫
+    /// </summary>
+    public partial class MaskWindow : WindowX
+    {
+
+        private Action<MaskWindow> action;
+        private int delay;
+        public MaskWindow(Window window, Action<MaskWindow> action)
+        {
+            Owner = window;
+            DataContext = this;
+            this.action = action;
+            InitializeComponent();
+            ContentRendered += MaskWindow_ContentRendered; ;
+        }
+
+        private string status;
+
+        public string Status
+        {
+            get { return status; }
+            set { Set(ref status, value); }
+        }
+
+
+        public void Info(string message, int delay = 100)
+        {
+            Status = "Info";
+            label.Content = message;
+            this.delay = delay;
+            this.ShowDialog();
+        }
+
+        private void MaskWindow_ContentRendered(object sender, EventArgs e)
+        {
+            //Dispatcher.InvokeAsync(new Action(() =>
+            //{
+            //    鏆傚仠绾跨▼浠I瀹屽叏灞曠ず
+            //    if (delay > 0) Thread.Sleep(delay);
+            //    action(this);
+            //}));
+            Task.Run(() =>
+            {
+                try
+                {
+                    // 鏆傚仠绾跨▼浠I瀹屽叏灞曠ず
+                    if (delay > 0) Thread.Sleep(delay);
+                    action(this);
+                }
+                finally
+                {
+                    Dispatcher.Invoke(() =>
+                    {
+                        this.Close();
+                    });
+                }
+            });
+        }
+
+        private void MaskWindow_Loaded(object sender, RoutedEventArgs e)
+        {
+
+        }
+    }
+}

--
Gitblit v1.9.1