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

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

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

            if (maskedText != null)
            {
                maskedText.Dispose();
                SetInstance(d, null);
            }
        }
예제 #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();
            }
        }
예제 #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();
                }
            }
        }
예제 #6
0
 private static void SetInstance(DependencyObject d, MaskedText value)
 {
     d.SetValue(InstanceProperty, value);
 }