コード例 #1
0
        private static void OnPasswordChanged(object sender, RoutedEventArgs e)
        {
            PasswordBox passwordBox = sender as PasswordBox;

            if (passwordBox == null)
            {
                return;
            }

            OverlayTextAdorner adorner = (OverlayTextAdorner)passwordBox.GetValue(OverlayTextAdornerProperty);

            if (adorner != null)
            {
                adorner.OnTargetElementTextChanged(passwordBox.Password);
            }
        }
コード例 #2
0
        private static void OnTextChanged(object sender, TextChangedEventArgs e)
        {
            TextBox textBox = sender as TextBox;

            if (textBox == null)
            {
                return;
            }

            OverlayTextAdorner adorner = (OverlayTextAdorner)textBox.GetValue(OverlayTextAdornerProperty);

            if (adorner != null)
            {
                adorner.OnTargetElementTextChanged(textBox.Text);
            }
        }