From 006c98e5650b530e5220f279c1e803fefe69d40d Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期二, 25 十一月 2025 15:47:33 +0800
Subject: [PATCH] 优化一些东西;

---
 WPFProject/LoadingWindow.xaml.cs |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/WPFProject/LoadingWindow.xaml.cs b/WPFProject/LoadingWindow.xaml.cs
index e0c4fc1..4e1ff79 100644
--- a/WPFProject/LoadingWindow.xaml.cs
+++ b/WPFProject/LoadingWindow.xaml.cs
@@ -1,5 +1,4 @@
 锘縰sing HMI.Base;
-using HMI.Core.Api;
 using HMI.UI.Util;
 using Panuon.WPF.UI;
 using System;
@@ -85,9 +84,11 @@
 
         private void Button_Click(object sender, RoutedEventArgs e)
         {
+            this.Closed -= ShutDownWhen_Closed;
             window.Show();
             this.Close();
         }
+
         private PanuonWindow window;
         private double total;
         private double finished;
@@ -116,9 +117,15 @@
                 ShowConsole = true;
                 BtnNext.Visibility = Visibility.Visible;
                 MsgBoxHelper.Error(this, "鍔犺浇鍑洪敊锛岃纭");
+                this.Closed += ShutDownWhen_Closed; ;
             }
         }
 
+        private void ShutDownWhen_Closed(object sender, EventArgs e)
+        {
+            Application.Current.Shutdown();
+        }
+
         public void Add(string text, bool? result)
         {
             Message = text;

--
Gitblit v1.9.1