0

Can someone upload an example or provide me with some help on implementing IValidatableObject and showing the validation erros on a WPF (MVVM) application using IDataErrorInfo. I red 3d answer on this post: IDataErrorInfo vs IValidatableObject?

I'm working with net 4.5.

Community
  • 1
  • 1
rahebirizah
  • 115
  • 11

1 Answers1

0

Take a look at the implementation here. To quote from the blog post:

When validating an object, the following process is applied in Validator.ValidateObject:

Validate property-level attributes If any validators are invalid, abort validation returning the failure(s) Validate the object-level attributes If any validators are invalid, abort validation returning the failure(s) If on the desktop framework and the object implements IValidatableObject, then call its Validate method and return any failure(s)

If you have more complex validation needs, it is really recommended to look into FuentValidation library.

Hadi Eskandari
  • 25,575
  • 8
  • 51
  • 65