Wpf – ValidationRule – validate on property update

textblockvalidationwpf

Greetings,
how can I validate if value in TextBlock is ok?
I have a TextBox where I bind "Amount" property and a TextBlock which uses Multibinding: Price Property and Amount property. I would like to do something like that:
In case of changing Amount i would like to validate if the price is greater than xx (which is the constant).
Thanks in advance

Best Solution

You have create validation rule class(derived from validation rule) for binding validation. Here is some sample to how to implement binding validation in WPF

Sample 1

Sample 2