how do I add a ValidationRule to my control that only fires when the control is enabled?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Have a look here, look under the ‘Custom validation rules’ and you could check it in the
public override ValidationResult Validatemethod.Just do
EDIT:
So, instead of doing your validation rule binding in XAML, I think you’ll need to do it in your code behind, and there you can assign a property you’ve created in your custom validation rule class to your current instance of your combobox, and then use that in your override of your
Validatemethod.So in your validationrule class
then when doing your validation rule binding
now you can use your
MyComboproperty in the Validate method to checkIsEnabled