alielie
2025-03-13 a3ba25607612818c28d421bfa8eb2f92339d71ac
WPFProject/App.xaml.cs
@@ -1,8 +1,10 @@
using HMI.UI.Util;
using HMI.Core.Util;
using HMI.UI.Util;
using log4net;
using Panuon.WPF.UI;
using System;
using System.Windows;
using WPFProject.Utils;
namespace WPFProject
{
@@ -22,17 +24,17 @@
        {
            var ex = e.ExceptionObject as Exception;
            log.Error("UnhandledException.", ex);
            Dispatcher.Invoke(() =>
            {
                MsgBoxHelper.ErrorMessage(Current.MainWindow, $"发生未知异常!程序即将关闭\r\n{ex?.Message}",
                    "错误", MessageBoxButton.OK,
            MsgBoxHelper.ErrorMessage(Current.MainWindow, this.lang("App.AppUnhandledException",ex.Message),
                    this.lang("App.Error"), MessageBoxButton.OK,
                    MessageBoxIcon.Error, DefaultButton.YesOK, 5);
            });
        }
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            LangUtil.Load();
            ToastHelper.Register(new MainToastHandler());
            LoadingWindow window = new LoadingWindow();
            //Login window = new Login();
            window.Show();
        }
    }