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(); }); } }); }