Exemplo n.º 1
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
        }