I have 2 PasswordBoxes. I need to check are passwords equal. I don’t want to write this condition into [].xaml.cs code, but i want to mark PasswordBox in red when passwords aren’t equal.
Should i write special ValidationRule, some code in ViewModel or something else? Can anyone help me? Now the validation is written in the [].xaml.cs but i want to avoid it.
Using:
Code (this code is not cover all cases):
Also, it’s possible to define dependency property with style of error and setting it instead of BorderBrush. But i don’t know how to use in this case the standard ErrorTemplate.