I came across Set a ValidationError by Code, by Christian Mosers
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);
How can I use th开发者_开发问答is in my ViewModel?
There are other ways to get errors out of the VM, for example by implementing IDataErrorInfo or by throwing exceptions in setters (the binding then needs to validate on exception).
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论