Manual WPF Validation Adding Errors to the Validation.Errors Assembly

Is there a way to manually / dynamically add errors to the Validation.Errors collection?

+7
validation wpf
source share
1 answer

from http://www.wpftutorial.net/ValidationErrorByCode.html

ValidationError validationError = new ValidationError(regexValidationRule, textBox.GetBindingExpression(TextBox.TextProperty)); validationError.ErrorContent = "This is not a valid e-mail address"; Validation.MarkInvalid( textBox.GetBindingExpression(TextBox.TextProperty), validationError); 
+16
source share

All Articles