Interface FormViewModelBase.IValidationEntry<T>
Defines a set of members available to configure a validation rule.
Namespace: TheXDS.MCART.Types.Base
Assembly: MCART.Mvvm.dll
Syntax
protected interface FormViewModelBase.IValidationEntry<T>
Type Parameters
| Name | Description |
|---|---|
| T | Property type. |
Methods
| Edit this page View SourceAddRule(Func<T, bool>)
Adds a validation rule to the entry.
Declaration
FormViewModelBase.IValidationEntry<T> AddRule(Func<T, bool> rule)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<T, bool> | rule | Function that performs validation. Must return true if the value passes the test, false otherwise. |
Returns
| Type | Description |
|---|---|
| FormViewModelBase.IValidationEntry<T> | This same entry to allow fluent chaining. |
AddRule(Func<T, bool>, string)
Adds a validation rule to the entry.
Declaration
FormViewModelBase.IValidationEntry<T> AddRule(Func<T, bool> rule, string error)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<T, bool> | rule | Function that performs validation. Must return true if the value passes the test, false otherwise. |
| string | error | Error message to present if validation fails. |
Returns
| Type | Description |
|---|---|
| FormViewModelBase.IValidationEntry<T> | This same entry to allow fluent chaining. |