I am implementing a custom ValidationRule
for WPF DataBinding. To do this, I just inherit from ValidationRule
and implement one or more of a few abstract or virtual methods. This is the method I am implementing:
public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo, System.Windows.Data.BindingExpressionBase owner)
The ValidationResult
object I am returning must either have true
or false
for the IsValid
property. This logically seems to me to be missing the third option Unknown or Undetermined. In some cases, a validator may not apply.
So what should I return in these cases? Can I safely return null
?