From 1fca2167068e9ef2c079ec742f20313fc6697ab1 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期一, 03 三月 2025 09:18:33 +0800
Subject: [PATCH] 完善代码;

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

diff --git a/WPFProject/LoadingWindow.xaml.cs b/WPFProject/LoadingWindow.xaml.cs
index a9755db..6a857bb 100644
--- a/WPFProject/LoadingWindow.xaml.cs
+++ b/WPFProject/LoadingWindow.xaml.cs
@@ -1,4 +1,5 @@
-锘縰sing System.Windows;
+锘縰sing System.Threading.Tasks;
+using System.Windows;
 using HMI.Base;
 
 namespace WPFProject
@@ -23,7 +24,10 @@
 
         private void Loader_LoadMessageAppend(object sender, string e)
         {
-            Console.Text += $"{e}\r\n";
+            Dispatcher.BeginInvoke(() =>
+            {
+                Console.Text = Console.Text+$"{e}\r\n";
+            });
         }
 
         private void Button_Click(object sender, RoutedEventArgs e)

--
Gitblit v1.9.1