I have a TextBox on my View, that has a Validation Rule:
public class EmptyStringRule : ValidationRule
{
public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
{
if(String.IsNullOrEmpty(value.ToString()))
return new ValidationResult(true,"String Cannot be empty");
return new ValidationResult(true,null);
}
}
When an empty string is entered. the bound property is not updated and the Textbox is marked red. I need to update the Source but still keep the Marker around the Textbox. (The Input is later Validated Again by EF).
How can i do so?