alielie
2025-03-28 dedcf4174c8540ee3a912daad2ff13e014e495b1
WPFProject/LoadingWindow.xaml.cs
@@ -1,4 +1,5 @@
using 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);