Example #1
0
 /// <summary>
 /// Clears the ValidationError that was set through a call 
 /// to MarkInvalid or a previously failed validation of that BindingExpression.
 /// </summary>
 public static void ClearInvalid(BindingExpressionBase bindingExpression)
 { 
     if (bindingExpression == null)
         throw new ArgumentNullException("bindingExpression"); 
     bindingExpression.UpdateValidationError(null); 
 }
Example #2
0
        /// <summary>
        /// Mark this BindingExpression as invalid.  If the BindingExpression has been
        /// explicitly marked invalid in this way, then it will remain 
        /// invalid until ClearInvalid is called or another transfer to the source validates successfully.
        /// </summary> 
        public static void MarkInvalid(BindingExpressionBase bindingExpression, ValidationError validationError) 
        {
            if (bindingExpression == null) 
                throw new ArgumentNullException("bindingExpression");
            if (validationError == null)
                throw new ArgumentNullException("validationError");
 
            bindingExpression.UpdateValidationError(validationError);
        }