The recording of the first ever ReactiveUI virtual conference is available on our YouTube Channel.

ValidationContext Class

Summary

The overall context for a view model under which validation takes place.
Namespace
ReactiveUI.Validation.Contexts
Interfaces
Base Types
graph BT Type-->Base0["ReactiveObject"] click Base0 "/api/ReactiveUI/ReactiveObject" Base0-->Base1["object"] Type-.->Interface0["IReactiveNotifyPropertyChanged<IReactiveObject>"] Type-.->Interface1["IHandleObservableErrors"] click Interface1 "/api/ReactiveUI/IHandleObservableErrors" Type-.->Interface2["IReactiveObject"] click Interface2 "/api/ReactiveUI/IReactiveObject" Type-.->Interface3["INotifyPropertyChanged"] Type-.->Interface4["INotifyPropertyChanging"] Type-.->Interface5["IEnableLogger"] click Interface5 "/api/Splat/IEnableLogger" Type-.->Interface6["IDisposable"] Type-.->Interface7["IValidationComponent"] click Interface7 "/api/ReactiveUI.Validation.Components.Abstractions/IValidationComponent" Type["ValidationContext"] class Type type-node

Syntax

[SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Field _disposables disposes the items.")]
public class ValidationContext : ReactiveObject, IReactiveNotifyPropertyChanged<IReactiveObject>, 
    IHandleObservableErrors, IReactiveObject, INotifyPropertyChanged, INotifyPropertyChanging, 
    IEnableLogger, IDisposable, IValidationComponent

Remarks

Contains all of the IValidationComponent instances applicable to the view model.

Attributes

Type Description
SuppressMessageAttribute

Constructors

Name Summary
ValidationContext(IScheduler?) Initializes a new instance of the ValidationContext class.

Events

Name Type Summary
PropertyChanged PropertyChangedEventHandler?
Inherited from ReactiveObject
PropertyChanging PropertyChangingEventHandler?
Inherited from ReactiveObject

Properties

Name Value Summary
Changed IObservable<IReactivePropertyChangedEventArgs<IReactiveObject>>
Gets an Observable that fires *after* a property has changed. Note that this should not fire duplicate change notifications if a property is set to the same value multiple times.
Inherited from ReactiveObject
Changing IObservable<IReactivePropertyChangedEventArgs<IReactiveObject>>
Gets an observable that fires *before* a property is about to be changed. Note that this should not fire duplicate change notifications if a property is set to the same value multiple times.
Inherited from ReactiveObject
IsValid bool
Gets a value indicating whether the validation is currently valid or not.
Text ValidationText
ThrownExceptions IObservable<Exception>
Gets a observable which will fire whenever an exception would normally terminate ReactiveUI internal state.
Inherited from ReactiveObject
Valid IObservable<bool>
Gets an observable for the Valid state.
Validations ReadOnlyObservableCollection<IValidationComponent>
Gets get the list of validations.
ValidationStatusChange IObservable<IValidationState>
Gets the observable for validation state changes.

Methods

Name Value Summary
Add(IValidationComponent) void
Adds a validation into the validations collection.
AreChangeNotificationsEnabled() bool
Determines if change notifications are enabled or not.
Inherited from ReactiveObject
DelayChangeNotifications() IDisposable
Delays notifications until the return IDisposable is disposed.
Inherited from ReactiveObject
Dispose() void
Dispose(bool) void
Disposes of the managed resources.
GetIsValid() bool
Returns if the whole context is valid checking all the validations.
Remove(IValidationComponent) void
Removes a validation from the validations collection.
RemoveMany(IEnumerable<IValidationComponent>) void
Removes many validation components from the validations collection.
SuppressChangeNotifications() IDisposable
When this method is called, an object will not fire change notifications (neither traditional nor Observable notifications) until the return value is disposed.
Inherited from ReactiveObject

Extension Methods

Name Value Summary
AutoPersist<ValidationContext, TDontCare>(Func<ValidationContext, IObservable<Unit>>, IObservable<TDontCare>, TimeSpan?) IDisposable
AutoPersist allows you to automatically call a method when an object has changed, throttling on a certain interval. Note that this object must mark its persistable properties via the [DataMember] attribute. Changes to properties not marked with DataMember will not trigger the object to be saved.
AutoPersist<ValidationContext>(Func<ValidationContext, IObservable<Unit>>, TimeSpan?) IDisposable
AutoPersist allows you to automatically call a method when an object has changed, throttling on a certain interval. Note that this object must mark its persistable properties via the [DataMember] attribute. Changes to properties not marked with DataMember will not trigger the object to be saved.
BindCommand<ValidationContext, TViewModel, TProp, TControl, TParam>(TViewModel?, Expression<Func<TViewModel, TProp?>>, Expression<Func<ValidationContext, TControl>>, Expression<Func<TViewModel, TParam?>>, string?) IReactiveBinding<TView, TProp>
Bind a command from the ViewModel to an explicitly specified control on the View.
BindCommand<ValidationContext, TViewModel, TProp, TControl, TParam>(TViewModel?, Expression<Func<TViewModel, TProp?>>, Expression<Func<ValidationContext, TControl>>, IObservable<TParam?>, string?) IReactiveBinding<TView, TProp>
Bind a command from the ViewModel to an explicitly specified control on the View.
BindCommand<ValidationContext, TViewModel, TProp, TControl>(TViewModel?, Expression<Func<TViewModel, TProp?>>, Expression<Func<ValidationContext, TControl>>, string?) IReactiveBinding<TView, TProp>
Bind a command from the ViewModel to an explicitly specified control on the View.
BindValidation<ValidationContext, TViewModel, TViewModelProperty, TViewProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty>>, Expression<Func<ValidationContext, TViewProperty>>, IValidationTextFormatter<string>?) IDisposable
Binds the specified ViewModel property validation to the View property.
BindValidation<ValidationContext, TViewModel, TViewModelProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidation<ValidationContext, TViewModel, TViewModelProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidation<ValidationContext, TViewModel, TViewProperty>(TViewModel?, Expression<Func<ValidationContext, TViewProperty>>, IValidationTextFormatter<string>?) IDisposable
Binds the overall validation of a ViewModel to a specified View property.
BindValidation<ValidationContext, TViewModel, TViewProperty>(TViewModel?, Expression<Func<TViewModel?, ValidationHelper?>>, Expression<Func<ValidationContext, TViewProperty>>, IValidationTextFormatter<string>?) IDisposable
Binds a ValidationHelper from a ViewModel to a specified View property.
BindValidation<ValidationContext, TViewModel>(TViewModel?, Expression<Func<TViewModel?, ValidationHelper?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidation<ValidationContext, TViewModel>(TViewModel?, Expression<Func<TViewModel?, ValidationHelper?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidationEx<ValidationContext, TViewModel, TViewModelProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidationEx<ValidationContext, TViewModel, TViewModelProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
DisposeWith<ValidationContext>(CompositeDisposable) T
Ensures the provided disposable is disposed with the specified CompositeDisposable.
InvokeViewModelAction<T>(Action<T>) object
This is a thing I lifted from Prism.
Log<ValidationContext>() IFullLogger
Call this method to write log entries on behalf of the current class.
From LogHost
ObserveFor<TViewModel, TViewModelProperty>(Expression<Func<TViewModel, TViewModelProperty>>, bool) IObservable<IList<IValidationState>>
Resolves the IValidationState for a specified property in a reactive fashion.
RaiseAndSetIfChanged<ValidationContext, TRet>(TRet, TRet, string?) TRet
RaiseAndSetIfChanged fully implements a Setter for a read-write property on a ReactiveObject, using CallerMemberName to raise the notification and the ref to the backing field to set the property.
RaisePropertyChanged<ValidationContext>(string?) void
Use this method in your ReactiveObject classes when creating custom properties where raiseAndSetIfChanged doesn't suffice.
RaisePropertyChanging<ValidationContext>(string?) void
Use this method in your ReactiveObject classes when creating custom properties where raiseAndSetIfChanged doesn't suffice.
SubscribePropertyChangedEvents<ValidationContext>() void
Use this method for enabling classic PropertyChanged events when you are implementing IReactiveObject manually.
SubscribePropertyChangingEvents<ValidationContext>() void
Use this method for enabling classic PropertyChanging events when you are implementing IReactiveObject manually.
WhenAnyObservable<ValidationContext, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Expression<Func<ValidationContext, IObservable<T1>?>>, Expression<Func<ValidationContext, IObservable<T2>?>>, Expression<Func<ValidationContext, IObservable<T3>?>>, Expression<Func<ValidationContext, IObservable<T4>?>>, Expression<Func<ValidationContext, IObservable<T5>?>>, Expression<Func<ValidationContext, IObservable<T6>?>>, Expression<Func<ValidationContext, IObservable<T7>?>>, Expression<Func<ValidationContext, IObservable<T8>?>>, Expression<Func<ValidationContext, IObservable<T9>?>>, Expression<Func<ValidationContext, IObservable<T10>?>>, Expression<Func<ValidationContext, IObservable<T11>?>>, Expression<Func<ValidationContext, IObservable<T12>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, T9?, T10?, T11?, T12?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Expression<Func<ValidationContext, IObservable<T1>?>>, Expression<Func<ValidationContext, IObservable<T2>?>>, Expression<Func<ValidationContext, IObservable<T3>?>>, Expression<Func<ValidationContext, IObservable<T4>?>>, Expression<Func<ValidationContext, IObservable<T5>?>>, Expression<Func<ValidationContext, IObservable<T6>?>>, Expression<Func<ValidationContext, IObservable<T7>?>>, Expression<Func<ValidationContext, IObservable<T8>?>>, Expression<Func<ValidationContext, IObservable<T9>?>>, Expression<Func<ValidationContext, IObservable<T10>?>>, Expression<Func<ValidationContext, IObservable<T11>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, T9?, T10?, T11?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Expression<Func<ValidationContext, IObservable<T1>?>>, Expression<Func<ValidationContext, IObservable<T2>?>>, Expression<Func<ValidationContext, IObservable<T3>?>>, Expression<Func<ValidationContext, IObservable<T4>?>>, Expression<Func<ValidationContext, IObservable<T5>?>>, Expression<Func<ValidationContext, IObservable<T6>?>>, Expression<Func<ValidationContext, IObservable<T7>?>>, Expression<Func<ValidationContext, IObservable<T8>?>>, Expression<Func<ValidationContext, IObservable<T9>?>>, Expression<Func<ValidationContext, IObservable<T10>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, T9?, T10?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9>(Expression<Func<ValidationContext, IObservable<T1>?>>, Expression<Func<ValidationContext, IObservable<T2>?>>, Expression<Func<ValidationContext, IObservable<T3>?>>, Expression<Func<ValidationContext, IObservable<T4>?>>, Expression<Func<ValidationContext, IObservable<T5>?>>, Expression<Func<ValidationContext, IObservable<T6>?>>, Expression<Func<ValidationContext, IObservable<T7>?>>, Expression<Func<ValidationContext, IObservable<T8>?>>, Expression<Func<ValidationContext, IObservable<T9>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, T9?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet, T1, T2, T3, T4, T5, T6, T7, T8>(Expression<Func<ValidationContext, IObservable<T1>?>>, Expression<Func<ValidationContext, IObservable<T2>?>>, Expression<Func<ValidationContext, IObservable<T3>?>>, Expression<Func<ValidationContext, IObservable<T4>?>>, Expression<Func<ValidationContext, IObservable<T5>?>>, Expression<Func<ValidationContext, IObservable<T6>?>>, Expression<Func<ValidationContext, IObservable<T7>?>>, Expression<Func<ValidationContext, IObservable<T8>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet, T1, T2, T3, T4, T5, T6, T7>(Expression<Func<ValidationContext, IObservable<T1>?>>, Expression<Func<ValidationContext, IObservable<T2>?>>, Expression<Func<ValidationContext, IObservable<T3>?>>, Expression<Func<ValidationContext, IObservable<T4>?>>, Expression<Func<ValidationContext, IObservable<T5>?>>, Expression<Func<ValidationContext, IObservable<T6>?>>, Expression<Func<ValidationContext, IObservable<T7>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet, T1, T2, T3, T4, T5, T6>(Expression<Func<ValidationContext, IObservable<T1>?>>, Expression<Func<ValidationContext, IObservable<T2>?>>, Expression<Func<ValidationContext, IObservable<T3>?>>, Expression<Func<ValidationContext, IObservable<T4>?>>, Expression<Func<ValidationContext, IObservable<T5>?>>, Expression<Func<ValidationContext, IObservable<T6>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet, T1, T2, T3, T4, T5>(Expression<Func<ValidationContext, IObservable<T1>?>>, Expression<Func<ValidationContext, IObservable<T2>?>>, Expression<Func<ValidationContext, IObservable<T3>?>>, Expression<Func<ValidationContext, IObservable<T4>?>>, Expression<Func<ValidationContext, IObservable<T5>?>>, Func<T1?, T2?, T3?, T4?, T5?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet, T1, T2, T3, T4>(Expression<Func<ValidationContext, IObservable<T1>?>>, Expression<Func<ValidationContext, IObservable<T2>?>>, Expression<Func<ValidationContext, IObservable<T3>?>>, Expression<Func<ValidationContext, IObservable<T4>?>>, Func<T1?, T2?, T3?, T4?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet, T1, T2, T3>(Expression<Func<ValidationContext, IObservable<T1>?>>, Expression<Func<ValidationContext, IObservable<T2>?>>, Expression<Func<ValidationContext, IObservable<T3>?>>, Func<T1?, T2?, T3?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet, T1, T2>(Expression<Func<ValidationContext, IObservable<T1>?>>, Expression<Func<ValidationContext, IObservable<T2>?>>, Func<T1?, T2?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet>(Expression<Func<ValidationContext, IObservable<TRet>?>>) IObservable<TRet>
Observe a observable which is set to a property, and automatically subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet>(Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet>(Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet>(Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet>(Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet>(Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet>(Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet>(Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet>(Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet>(Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet>(Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ValidationContext, TRet>(Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>, Expression<Func<ValidationContext, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
With<ValidationContext, TKey, TField>(Dictionary<TKey, TField>, IDictionary<TKey, TField>) TBuilder
Adds the specified dictionary to the provided dictionary.