Beispiel #1
0
        private static void OnHidePromptOnLeaveChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            MaskedText maskedText = GetInstance(d);

            if (maskedText != null)
            {
                maskedText.SetText();
            }
        }
Beispiel #2
0
        private static void OnIncludePromptChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            MaskedText maskedText = GetInstance(d);

            if (maskedText != null)
            {
                maskedText.CreateProvider();
            }
        }
Beispiel #3
0
        private static void Unattach(DependencyObject d)
        {
            MaskedText maskedText = GetInstance(d);

            if (maskedText != null)
            {
                maskedText.Dispose();
                SetInstance(d, null);
            }
        }
Beispiel #4
0
        private static void OnPromptCharChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            MaskedText maskedText = GetInstance(d);

            if (maskedText != null)
            {
                maskedText._provider.PromptChar = (char)e.NewValue;
                maskedText.SetText();
            }
        }
Beispiel #5
0
        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();
                }
            }
        }
Beispiel #6
0
 private static void SetInstance(DependencyObject d, MaskedText value)
 {
     d.SetValue(InstanceProperty, value);
 }