Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF: Run validation only if control is enabled

$
0
0

I am applying binding validation to a few WPF controls in .NET 4.0. Currently, my controls turn red and display a little warning message when they fail a certain set of ValidationRules. The problem is that, they still fail their respective validations even though they are disabled. This lead to the disabled control to have a red border and a warning message. This could be misleading to the end user and therefore I would only like validation to run if the controls are enabled. I am not exactly sure how to implement this functionality.

I validate through Binding.ValidationRule which connects to a specific validation class.



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>