private void PasswordBox_KeyUp(object sender, KeyRoutedEventArgs e) { if (e.Key == VirtualKey.Enter) { if (passwordBox.Password == HomePassword) { MainPage.LeftMenuAccess.IsEnabled = true; access = true; wrongPasswordTXT.Visibility = Visibility.Collapsed; blocker.LoginControlsHidden(isLogged: true, LogoutBTN, passwordBox, PasswordTXT); passwordBox.Password = string.Empty; } else { wrongPasswordTXT.Visibility = Visibility.Visible; passwordBox.Password = string.Empty; } } }