Should IDataErrorInfo.Error check every property? Or can I trust any clients to call IDataErrorInfo.Item on every property?
IDataErrorInfo.Error is used to report the validation state for the whole object.
For example if your object have properties StartTime and EndTime you will probably want StartTime to be less than the EndTime and if this validation rule is broken it wont be appropriate to display a message neither for one nor the other property.
Error property is also appropriate to summarize the overall validation state of your object. So the answer is no - you shouldn't check every property. The error messages related to particular property are exposed by
string this[string columnName]
indexer.
EDIT: here a link that explains how the interface is supposed to be used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With