alielie
2025-08-25 c4a3f8db90530a727ffab77c3bb5bb7d782792bf
WPFProject/LoadingWindow.xaml.cs
@@ -37,7 +37,8 @@
            }
        }
        public Visibility ConsoleVisiable {
        public Visibility ConsoleVisiable
        {
            get => showConsole ? Visibility.Visible : Visibility.Collapsed;
        }
@@ -65,7 +66,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 +84,23 @@
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            PanuonWindow window = new PanuonWindow();
            this.Closed -= ShutDownWhen_Closed;
            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);
                //
            });
        }
@@ -114,7 +117,13 @@
                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)
@@ -132,7 +141,7 @@
            };
            //也可以插入到最后面
            Console.Document.Blocks.InsertAfter(Console.Document.Blocks.LastBlock, paragraph);
            //插入到最前面
            //rtxtLog.Document.Blocks.Add(paragraph);