Show / Hide Table of Contents

Class ValidationSource<T>

Executes data validations within an IValidatingViewModel.

Inheritance
object
ValidationSource
ValidationSource<T>
Implements
INotifyDataErrorInfo
Inherited Members
ValidationSource.ErrorsChanged
ValidationSource.HasErrors
ValidationSource.PassesValidation
ValidationSource.this[string]
ValidationSource.CheckErrors()
ValidationSource.GetErrors(string)
ValidationSource.GetErrors()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TheXDS.MCART.Types.Base
Assembly: MCART.Mvvm.dll
Syntax
public sealed class ValidationSource<T> : ValidationSource, INotifyDataErrorInfo where T : IValidatingViewModel
Type Parameters
Name Description
T

The ViewModel type whose data will be validated by this instance.

Constructors

| Edit this page View Source

ValidationSource(T)

Executes data validations within an IValidatingViewModel.

Declaration
public ValidationSource(T npcSource)
Parameters
Type Name Description
T npcSource

Instance that is the source of validation data.

Methods

| Edit this page View Source

GetErrors(Expression<Func<T, object?>>)

Enumerates validation errors for the specified property.

Declaration
public IEnumerable<string> GetErrors(Expression<Func<T, object?>> propertySelector)
Parameters
Type Name Description
Expression<Func<T, object>> propertySelector

Property for which to obtain validation errors.

Returns
Type Description
IEnumerable<string>

An enumeration with all validation errors for the selected property.

| Edit this page View Source

RegisterValidation<TValue>(Expression<Func<T, TValue>>)

Registers a set of rules in the validation instance.

Declaration
public IValidationEntry<TValue> RegisterValidation<TValue>(Expression<Func<T, TValue>> propertySelector)
Parameters
Type Name Description
Expression<Func<T, TValue>> propertySelector

Expression that selects the property to configure.

Returns
Type Description
IValidationEntry<TValue>

The same validation-instance to allow Fluent syntax.

Type Parameters
Name Description
TValue

Type of the property.

Implements

INotifyDataErrorInfo

Extension Methods

Objects.ShallowCopyTo(object, object, Type)
ObjectExtensions.FieldsOf<T>(object)
ObjectExtensions.GetAttribute<T>(object)
ObjectExtensions.GetAttributes<T>(object)
ObjectExtensions.HasAttrValue<TAttribute, TValue>(object, out TValue)
ObjectExtensions.HasAttribute<T>(object)
ObjectExtensions.HasAttribute<T>(object, out T?)
ObjectExtensions.HasAttributes<T>(object, out IEnumerable<T>?)
ObjectExtensions.Is(object?, object?)
ObjectExtensions.IsEither(object, IEnumerable)
ObjectExtensions.IsEither(object, params object[])
ObjectExtensions.IsNeither(object, IEnumerable)
ObjectExtensions.IsNeither(object, params object[])
ObjectExtensions.IsNot(object?, object?)
ObjectExtensions.PropertiesOf<T>(object)
ObjectExtensions.WhichAre(object, IEnumerable<object>)
ObjectExtensions.WhichAre(object, params object[])
Common.IfNotNull<T>(T?, Action<T>)
Objects.Itself<T>(T)
Objects.ShallowCopyTo<T>(T, T)
CollectionExtensions.PushInto<TItem, TCollection>(TItem, ICollection<TCollection>)
DictionaryExtensions.PushInto<TKey, TValue>(TValue, TKey, IDictionary<TKey, TValue>)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX