Add validation error outside of the Validate methods (e.g. after Save)

Topics: Questions
Aug 9, 2012 at 12:39 PM

Is there a way to add a validation error outside of the Validate methods?

Lets say the user enters data and sends them to a webservice. The webservice returns that the Name must be unique - so an error that cannot be checked on the client alone.

Now it would be nice to use the existing system to display the error and mark the Name Textbox.


Aug 9, 2012 at 1:38 PM

You can use any type of validation that you prefer. For more information, see this documentation.

Catel supports the Validate methods, data annotations (attributes), IDataErrorInfo and INotifyDataErrorInfo out of the box. We also have an extension library for FluentValidation which implements the IValidationProvider for FluentValidation. If you want something else to use for validation, you will have to implement and register your own IValidationProvider.