Click or drag to resize

ValidationTemplate Class

A validation template for using Validar.Fody (https://github.com/Fody/Validar) with data annotations (System.ComponentModel.DataAnnotations).

Inheritance Hierarchy
SystemObject
  TomsToolbox.DesktopValidationTemplate

Namespace: TomsToolbox.Desktop
Assembly: TomsToolbox.Desktop (in TomsToolbox.Desktop.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntax
public class ValidationTemplate : IDataErrorInfo, 
	INotifyDataErrorInfo

The ValidationTemplate type exposes the following members.

Constructors
 NameDescription
Public methodValidationTemplate Initializes a new instance of the ValidationTemplate class.
Top
Properties
 NameDescription
Public propertyErrorGets an error message indicating what is wrong with this object.
Public propertyItemGets the error message for the property with the given name.
Top
Events
 NameDescription
Public eventErrorsChanged Raised when the errors for a property has changed.
Top
Extension Methods
 NameDescription
Public Extension MethodSafeCastT Performs a cast from object to T, avoiding possible null violations if T is a value type.
(Defined by ObjectExtensions)
Top
Example
To activate the validation template just add this line to your AssemblyInfo.cs after you have installed the Validar.Fody package:

C#
[assembly: ValidationTemplateAttribute(typeof(TomsToolbox.Desktop.ValidationTemplate))]
See Also