wenxiangchao
2026-11-02 9d1660270272180cd71147d6ddd53d1382643d2e
HMI.UI/MaskWindow.xaml.cs
@@ -42,11 +42,27 @@
        private void MaskWindow_ContentRendered(object sender, EventArgs e)
        {
            //Dispatcher.InvokeAsync(new Action(() =>
            //{
            //    暂停线程令UI完全展示
            //    if (delay > 0) Thread.Sleep(delay);
            //    action(this);
            //}));
            Task.Run(() =>
            {
                // 暂停线程令UI完全展示
                if (delay > 0) Thread.Sleep(delay);
                action(this);
                try
                {
                    // 暂停线程令UI完全展示
                    if (delay > 0) Thread.Sleep(delay);
                    action(this);
                }
                finally
                {
                    Dispatcher.Invoke(() =>
                    {
                        this.Close();
                    });
                }
            });
        }