コード例 #1
0
ファイル: App.xaml.cs プロジェクト: dennyli/HandySolution
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            if (_bootstrapper == null)
            {
                _bootstrapper = new LighterBootstrapper();
            }

#if WITH_TOKEN
            LoginView loginView = _bootstrapper.GetExportedValue <LoginView>();
            loginView.InitializeEventAggregator();

            this.ShutdownMode = ShutdownMode.OnExplicitShutdown;
            if (loginView.ShowDialog() == true)
            {
                this.ShutdownMode = ShutdownMode.OnMainWindowClose;
#endif
            _bootstrapper.RunShell();
#if WITH_TOKEN
        }

        else
        {
            Shutdown();
        }
#endif
        }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: dennyli/HandySolution
        protected override void OnExit(ExitEventArgs e)
        {
            if (_bootstrapper != null)
            {
                _bootstrapper.Dispose();
                _bootstrapper = null;
            }

            base.OnExit(e);
        }