validation - WPF ValidationRule when control IsEnabled=false -
How do I add a validation rule in my control which starts to fire if only control is enabled is?
Thank you.
Take a look, look under the 'Custom Validation Rule' and you can call it the public override validation Related value in the
method.
Just do
if (mytextbox.IsEnabled) {// validate here}
Edit:
Therefore, instead of enforcing your verification rule to force XAML, I think you have to back it up in your code, and you can do this in your custom verification rules category in your current example of your combobox. Assign the property you created, and then enter your override of your valid
method. Use.
Therefore Validation Class
Public Combo Box Mycombo (Received; Set; }
Then when binding your verification rule
myvalidationinstance.MyCombo = mycombobox;
You can now check your MyCombo
in valid method to check IsEnabled
Comments
Post a Comment