123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using Prism.Ioc;
- using Prism.Modularity;
- using Prism.Unity;
- using System;
- using System.Threading;
- using System.Windows;
- using Venus_MainPages.Views;
- using Venus_UI.Views;
- using WPF.Themes.UserControls;
- namespace Venus_UI
- {
- /// <summary>
- /// App.xaml 的交互逻辑
- /// </summary>
- public partial class App : PrismApplication
- {
- System.Threading.Mutex mutex;
- protected override void OnStartup(StartupEventArgs e)
- {
- bool ret;
- mutex = new System.Threading.Mutex(true, "Venus_UI", out ret);
- if (!ret)
- {
- WPFMessageBox.ShowError("Only One Venus_UI is allowed");
- Environment.Exit(0);
- }
-
- base.OnStartup(e);
- DispatcherUnhandledException += App_DispatcherUnhandledException;
- }
- void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
- {
- //MessageBox.Show("程序异常." + Environment.NewLine + e.Exception.Message);
- e.Handled = true;
- }
- protected override Window CreateShell()
- {
- return Container.Resolve<ShellView>();
- }
- protected override void RegisterTypes(IContainerRegistry containerRegistry)
- {
- }
- protected override IModuleCatalog CreateModuleCatalog()
- {
- return new ConfigurationModuleCatalog();
- }
- }
- }
|