I have a form with a handful of controls performing validation. Prior to saving a record, I make the following call:
ValidateChildren(ValidationConstraints.Enabled);
Most of the time this returns true, but sometimes it's returning false. Here is what I know:
1. All the Validating events are successful
2. It seems to happen after another record has been edited
3. It seems to happen due to ValidateChildren triggering data bound controls to write to their bindings on my business object properties. Business objects implement INotifyChanged and call PropertyChanged in property setters.
I've fixed a couple of places where this is happening by going to the property setters and checking to see if the value passed in is already the value for that property. If it is, return, which doesn't make the PropertyChanged call.
Is there something about the PropertyChanged event that makes validation fail?