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); } }
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); } }