示例#1
0
        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);
            }
        }
示例#2
0
        private static void HandlePasswordBoxLostFocus(Control sender, RoutedEventArgs e)
        {
            FrameworkElement frameworkElement = PasswordBoxHelper.FindCapsLockIndicator((Control)sender);

            if (frameworkElement != null)
            {
                frameworkElement.Visibility = Visibility.Collapsed;
            }
        }