protected override void OnStartup(StartupEventArgs e) { IAppViewModelFactory viewModelFactory = this.ConfigureContainer(); ILoginViewModel loginViewModel = viewModelFactory.ResolveViewModel <ILoginViewModel>(); loginViewModel.ShowDialog(); if (loginViewModel.DialogResult != null) { IMainViewModel mainViewModel = viewModelFactory.ResolveViewModel <IMainViewModel>(); mainViewModel.Closed += (s, ea) => this.Shutdown(); mainViewModel.Show(); } else { this.Shutdown(); } }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); this.ShutdownMode = ShutdownMode.OnExplicitShutdown; IAppViewModelFactory viewModelFactory = CreateAndConfigureFactory(); IMainViewModel mainViewModel = viewModelFactory.ResolveViewModel <IMainViewModel>(); mainViewModel.Closed += (s, ea) => this.Shutdown(); mainViewModel.Show(); }