private void Window_Closing(object sender, CancelEventArgs e) { if (!_loginSuccessful) { MessageBus.AfterLoginFailed(); } }