Table of Contents

Class ReactiveValidationObject

Namespace
ReactiveUI.Validation.Helpers
Assembly
ReactiveUI.Validation.dll

Base class for ReactiveObjects that support INotifyDataErrorInfo validation.

public abstract class ReactiveValidationObject : ReactiveObject, IValidatableViewModel, INotifyDataErrorInfo, IDisposable
Inheritance
ReactiveValidationObject
Implements
Extension Methods
WhenAnyMixin.WhenAny<TSender, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(TSender?, Expression<Func<TSender, T1>>, Expression<Func<TSender, T2>>, Expression<Func<TSender, T3>>, Expression<Func<TSender, T4>>, Expression<Func<TSender, T5>>, Expression<Func<TSender, T6>>, Expression<Func<TSender, T7>>, Expression<Func<TSender, T8>>, Expression<Func<TSender, T9>>, Expression<Func<TSender, T10>>, Expression<Func<TSender, T11>>, Expression<Func<TSender, T12>>, Func<IObservedChange<TSender, T1>, IObservedChange<TSender, T2>, IObservedChange<TSender, T3>, IObservedChange<TSender, T4>, IObservedChange<TSender, T5>, IObservedChange<TSender, T6>, IObservedChange<TSender, T7>, IObservedChange<TSender, T8>, IObservedChange<TSender, T9>, IObservedChange<TSender, T10>, IObservedChange<TSender, T11>, IObservedChange<TSender, T12>, TRet>)

Constructors

ReactiveValidationObject(IScheduler?, IValidationTextFormatter<string>?)

Initializes a new instance of the ReactiveValidationObject class.

protected ReactiveValidationObject(IScheduler? scheduler = null, IValidationTextFormatter<string>? formatter = null)

Parameters

scheduler IScheduler

Scheduler for the ValidationContext. Uses System.Reactive.Concurrency.CurrentThreadScheduler by default.

formatter IValidationTextFormatter<string>

Validation formatter. Defaults to SingleLineFormatter. In order to override the global default value, implement IValidationTextFormatter<TOut> and register an instance of IValidationTextFormatter<string> into Splat.Locator.

Properties

HasErrors

public bool HasErrors { get; }

Property Value

bool

ValidationContext

Gets get the validation context.

public IValidationContext ValidationContext { get; }

Property Value

IValidationContext

Methods

Dispose()

Releases unmanaged and - optionally - managed resources.

public void Dispose()

Dispose(bool)

Disposes the specified disposing.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

if set to true [disposing].

GetErrors(string?)

Returns a collection of error messages, required by the INotifyDataErrorInfo interface.

public virtual IEnumerable GetErrors(string? propertyName)

Parameters

propertyName string

Property to search error notifications for.

Returns

IEnumerable

A list of error messages, usually strings.

RaiseErrorsChanged(string)

Raises the ErrorsChanged event.

protected void RaiseErrorsChanged(string propertyName = "")

Parameters

propertyName string

The name of the validated property.

Events

ErrorsChanged

public event EventHandler<DataErrorsChangedEventArgs>? ErrorsChanged

Event Type

EventHandler<DataErrorsChangedEventArgs>