If I have the following TextBox:
You can use ValidationRules.
For instance, in my case, when a user enters an invalid value into a decimal datagridtextcolumn, instead of the default message "Value could not be converted" I can override it with:
and here's the code for the DecimalRule:
public override ValidationResult Validate(object value, CultureInfo cultureInfo)
{
decimal convertedDecimal;
if (!decimal.TryParse((string)value, out convertedDecimal))
{
return new ValidationResult(false, "My Custom Message"));
}
else
{
return new ValidationResult(true, null);
}
}