Show / Hide Table of Contents

Class ValidationSource

Executes data validations within an IValidatingViewModel.

Inheritance
object
ValidationSource
ValidationSource<T>
Implements
INotifyDataErrorInfo
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TheXDS.MCART.Types.Base
Assembly: MCART.Mvvm.dll
Syntax
public abstract class ValidationSource : INotifyDataErrorInfo

Properties

| Edit this page View Source

HasErrors

Gets a value that indicates whether the entity has validation errors.

Declaration
public bool HasErrors { get; }
Property Value
Type Description
bool

true if the entity currently has validation errors; otherwise, false.

| Edit this page View Source

this[string]

Gets a collection of validation error messages for the specified property.

Declaration
public IEnumerable<string> this[string propertyName] { get; }
Parameters
Type Name Description
string propertyName

Name of the property to retrieve error messages for.

Property Value
Type Description
IEnumerable<string>

An enumeration of error messages for the specified property, or an empty enumeration if the property has no errors.

| Edit this page View Source

PassesValidation

Indicates whether the object under validation has passed all validation checks.

Declaration
public bool PassesValidation { get; }
Property Value
Type Description
bool

Methods

| Edit this page View Source

CheckErrors()

Executes validation checks for all configured validation entries.

Declaration
public bool CheckErrors()
Returns
Type Description
bool

true if all validations passed; false otherwise.

| Edit this page View Source

GetErrors()

Enumerates validation error messages for all configured properties of the observed ViewModel.

Declaration
public IEnumerable<string> GetErrors()
Returns
Type Description
IEnumerable<string>

A collection with all validation error messages for the observed ViewModel.

| Edit this page View Source

GetErrors(string?)

Enumerates validation errors for the specified property or for all properties.

Declaration
public IEnumerable GetErrors(string? propertyName)
Parameters
Type Name Description
string propertyName

Property name to get validation errors for. If null or empty, errors for all properties are returned.

Returns
Type Description
IEnumerable

An enumeration with all validation errors for the property or the instance.

Events

| Edit this page View Source

ErrorsChanged

Occurs when the validation errors have changed for a property or for the entire entity.

Declaration
public event EventHandler<DataErrorsChangedEventArgs>? ErrorsChanged
Event Type
Type Description
EventHandler<DataErrorsChangedEventArgs>

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