Example #1
0
        protected override void OnExit(ExitEventArgs e)
        {
            if (_bootstrapper != null)
            {
                _bootstrapper.Dispose();
                _bootstrapper = null;
            }

            base.OnExit(e);
        }
Example #2
0
        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
        }