From 6bcafc823e836ecd5790f87178a906333699f868 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期四, 10 四月 2025 10:46:47 +0800
Subject: [PATCH] 优化插件结构;
---
WPFProject/LoadingWindow.xaml.cs | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/WPFProject/LoadingWindow.xaml.cs b/WPFProject/LoadingWindow.xaml.cs
index e9d50a4..e0c4fc1 100644
--- a/WPFProject/LoadingWindow.xaml.cs
+++ b/WPFProject/LoadingWindow.xaml.cs
@@ -1,4 +1,5 @@
锘縰sing HMI.Base;
+using HMI.Core.Api;
using HMI.UI.Util;
using Panuon.WPF.UI;
using System;
@@ -37,7 +38,8 @@
}
}
- public Visibility ConsoleVisiable {
+ public Visibility ConsoleVisiable
+ {
get => showConsole ? Visibility.Visible : Visibility.Collapsed;
}
@@ -65,7 +67,7 @@
Add(msg.Message, null);
break;
case LoadMsgType.LOADING:
- HasErr = msg.Result == false;
+ HasErr = HasErr || msg.Result == false;
if (msg.Result != null)
{
processBar.Value = ++finished / total * 100;
@@ -83,21 +85,21 @@
private void Button_Click(object sender, RoutedEventArgs e)
{
- PanuonWindow window = new PanuonWindow();
window.Show();
this.Close();
}
-
+ private PanuonWindow window;
private double total;
private double finished;
private void WindowX_ContentRendered(object sender, System.EventArgs e)
{
+ window = new PanuonWindow();
PluginLoader loader = PluginLoader.GetLoader();
loader.LoadMessageAppend += Loader_LoadMessageAppend;
Task.Run(() =>
{
- loader.LoadMenuAndPlugin(Dispatcher);
+ loader.LoadMenuAndPlugin(window, Dispatcher);
//
});
}
@@ -132,7 +134,7 @@
};
//涔熷彲浠ユ彃鍏ュ埌鏈�鍚庨潰
Console.Document.Blocks.InsertAfter(Console.Document.Blocks.LastBlock, paragraph);
-
+
//鎻掑叆鍒版渶鍓嶉潰
//rtxtLog.Document.Blocks.Add(paragraph);
--
Gitblit v1.9.1