I have a basic form with controls that are databound to an object implementing the INotifyPropertyChanged interface. I would like to add some validation to a couple of properties but dont want to go through implementing IDataErrorInfo for the sake of validating a couple of properties.
I have created the functions that perform the validation and return the error message (if applicable) in the object. What I would like to do is call these functions from my form when the relevant properties on the object have changed, and setup the ErrorProvider control in my form with any error messages that have been returned from the validation functions.
I have tried hooking up event handlers to the Validating and LostFocus events, but these seem to fire before my object is updated, and hence they are not validating the correct data. Its only when I leave the textbox, go back in and then leave again that the validation runs against the correct data.
Is there another event that I can hook into so that I can call these validation functions after the property on my object has been updated? Or am I better off just implementing the IDataErrorInfo interface?