private static void RefreshCapslockStatus(Control sender, RoutedEventArgs e) { FrameworkElement frameworkElement = PasswordBoxHelper.FindCapsLockIndicator((Control)sender); if (frameworkElement != null) { frameworkElement.Visibility = (Keyboard.IsKeyToggled(Key.Capital) ? Visibility.Visible : Visibility.Collapsed); } }
private static void HandlePasswordBoxLostFocus(Control sender, RoutedEventArgs e) { FrameworkElement frameworkElement = PasswordBoxHelper.FindCapsLockIndicator((Control)sender); if (frameworkElement != null) { frameworkElement.Visibility = Visibility.Collapsed; } }