using HMI.Core.Util; using HMI.UI.Util; using log4net; using Panuon.WPF.UI; using System; using System.Windows; using WPFProject.Utils; namespace WPFProject { /// /// App.xaml 的交互逻辑 /// public partial class App : Application { private ILog log; public App() { log = LogManager.GetLogger("APP"); AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; } private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { 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(); } } }