From ba6207f52db76ab47cd6534de0cf1712674ff179 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期四, 13 三月 2025 09:00:46 +0800
Subject: [PATCH] 完善国际化语言;
---
WPFProject/App.xaml.cs | 24 +++++++++++-------------
1 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/WPFProject/App.xaml.cs b/WPFProject/App.xaml.cs
index 2715cec..8a44641 100644
--- a/WPFProject/App.xaml.cs
+++ b/WPFProject/App.xaml.cs
@@ -1,14 +1,10 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Data;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Windows;
+锘縰sing HMI.Core.Util;
using HMI.UI.Util;
-using System.Windows.Markup;
using log4net;
using Panuon.WPF.UI;
+using System;
+using System.Windows;
+using WPFProject.Utils;
namespace WPFProject
{
@@ -26,17 +22,19 @@
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
- log.Error("鏈煡寮傚父", e.ExceptionObject as Exception);
- Dispatcher.Invoke(() =>
- {
- MsgBoxHelper.ErrorMessage(Current.MainWindow, $"鍙戠敓鏈煡寮傚父锛佺▼搴忓嵆灏嗗叧闂�", "閿欒", MessageBoxButton.OK,
+ var ex = e.ExceptionObject as Exception;
+ log.Error("UnhandledException.", ex);
+ 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();
}
}
--
Gitblit v1.9.1