示例#1
0
        public override void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var passwordBox = sender as PasswordBox;

            if (passwordBox == null)
            {
                return;
            }

            passwordBox.PasswordChanged -= PasswordBox_PasswordChanged;

            if ((bool)e.NewValue)
            {
                PasswordTextProperty.SetValue(passwordBox);
                passwordBox.PasswordChanged += PasswordBox_PasswordChanged;
            }
        }
示例#2
0
 private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e)
 {
     PasswordTextProperty.SetValue((PasswordBox)sender);
 }