protected override void OnStartup(StartupEventArgs e) { Current.ShutdownMode = ShutdownMode.OnExplicitShutdown; var window = new diags.LoginWindow(); bool? dialogResult = window.ShowDialog(); if ((dialogResult.HasValue == true) && (dialogResult.Value == true)) { base.OnStartup(e); Current.ShutdownMode = ShutdownMode.OnMainWindowClose; } else { this.Shutdown(); } }
protected override void OnStartup(StartupEventArgs e) { Current.ShutdownMode = ShutdownMode.OnExplicitShutdown; var window = new diags.LoginWindow(); bool?dialogResult = window.ShowDialog(); if ((dialogResult.HasValue == true) && (dialogResult.Value == true)) { base.OnStartup(e); Current.ShutdownMode = ShutdownMode.OnMainWindowClose; } else { this.Shutdown(); } }