private static void OnHidePromptOnLeaveChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { MaskedText maskedText = GetInstance(d); if (maskedText != null) { maskedText.SetText(); } }
private static void OnIncludePromptChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { MaskedText maskedText = GetInstance(d); if (maskedText != null) { maskedText.CreateProvider(); } }
private static void Unattach(DependencyObject d) { MaskedText maskedText = GetInstance(d); if (maskedText != null) { maskedText.Dispose(); SetInstance(d, null); } }
private static void OnPromptCharChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { MaskedText maskedText = GetInstance(d); if (maskedText != null) { maskedText._provider.PromptChar = (char)e.NewValue; maskedText.SetText(); } }
private static void Attach(DependencyObject d) { TextBox textBox = d as TextBox; if (textBox != null) { MaskedText maskedText = GetInstance(d); if (maskedText == null) { maskedText = new MaskedText(textBox); SetInstance(d, maskedText); } else { maskedText.CreateProvider(); } } }
private static void SetInstance(DependencyObject d, MaskedText value) { d.SetValue(InstanceProperty, value); }