I have a WPF
application(.Net 3.5
) which uses the IDataErrorInfo
on the ViewModel to validate input.
It works great, the usercontrol get the correct UI feedback.
The problem is that the user can still change the selected element, or save this element.
So my question is: How can I know that all my properties are valid? Or at least that all my displayed values are valid. The goal is to bind some IsActive
on this result
From your comment on your implementation of
IDataErrorInfo
change your implementation to this style....Then in your property changed event
For now, I added this method on my model.
I bound the object itself on the PropertyChanged event,
when it change, I call this method, and if the result is different than my actual public member, I update it:
And then I can just bind the IsValid property.
I don't know if there is a better solution?