public static void SetFormatValidationHandler(DependencyObject d, TextBoxFormatValidationHandler value)
 {
     if (DesignMode.DesignModeEnabled)
     {
         return;
     }
     d.SetValue(FormatValidationHandlerProperty, value);
 }
        private static void SetupAndValidate(TextBox textBox)
        {
            TextBoxFormatValidationHandler handler;

            if ((handler = GetFormatValidationHandler(textBox)) == null)
            {
                handler = new TextBoxFormatValidationHandler();
                SetFormatValidationHandler(textBox, handler);
            }
            else
            {
                handler.Validate();
            }
        }
 public static void SetFormatValidationHandler(DependencyObject d, TextBoxFormatValidationHandler value)
 {
     if (DesignMode.DesignModeEnabled) return;
     d.SetValue(FormatValidationHandlerProperty, value);
 }
        private static void SetupAndValidate(TextBox textBox)
        {
            TextBoxFormatValidationHandler handler;

            if ((handler = GetFormatValidationHandler(textBox)) == null)
            {
                handler = new TextBoxFormatValidationHandler();
                SetFormatValidationHandler(textBox, handler);
            }
            else
            {
                handler.Validate();
            }
        }