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: 1.0.69.0
Syntax
public class ValidationTemplate : IDataErrorInfo

The ValidationTemplate type exposes the following members.

Constructors
  NameDescription
Public methodValidationTemplate
Initializes a new instance of the ValidationTemplate class.
Top
Properties
  NameDescription
Public propertyError
Gets an error message indicating what is wrong with this object.
Public propertyItem
Gets the error message for the property with the given name.
Top
Extension Methods
  NameDescription
Public Extension MethodSafeCastT
Performs a cast from object to T, avoiding possible null violations if T is a value type.

[CanBeNull]

(Defined by ObjectExtensions.)
Top
Remarks
When using the net45 package, INotifyDataErrorInfo is supported as well.
Examples
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