예제 #1
0
        public override void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            if (!(sender is PasswordBox passwordBox))
            {
                return;
            }

            passwordBox.PasswordChanged -= PasswordChanged;
            if (!(bool)e.NewValue)
            {
                return;
            }

            HasTextProperty.SetValue(passwordBox);
            passwordBox.PasswordChanged += PasswordChanged;
        }
예제 #2
0
 private static void PasswordChanged(object sender, RoutedEventArgs e)
 {
     HasTextProperty.SetValue((PasswordBox)sender);
 }