Table of Contents

Class ValidationBinding

Namespace
ReactiveUI.Validation.ValidationBindings
Assembly
ReactiveUI.Validation.dll
public sealed class ValidationBinding : IValidationBinding, IDisposable
Inheritance
ValidationBinding
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>)
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>)
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>)
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>)

Methods

Dispose()

public void Dispose()

ForProperty<TView, TViewModel, TViewModelProperty, TOut>(TView, Expression<Func<TViewModel, TViewModelProperty>>, Action<IList<IValidationState>, IList<TOut>>, IValidationTextFormatter<TOut>, bool)

Creates a binding from a specified ViewModel property to a provided action. Such action binding allows to easily create new and more specialized platform-specific BindValidation extension methods like those we have in ViewForExtensions targeting the Android platform.

public static IValidationBinding ForProperty<TView, TViewModel, TViewModelProperty, TOut>(TView view, Expression<Func<TViewModel, TViewModelProperty>> viewModelProperty, Action<IList<IValidationState>, IList<TOut>> action, IValidationTextFormatter<TOut> formatter, bool strict = true) where TView : IViewFor<TViewModel> where TViewModel : class, IReactiveObject, IValidatableViewModel

Parameters

view TView

View instance.

viewModelProperty Expression<Func<TViewModel, TViewModelProperty>>

ViewModel property.

action Action<IList<IValidationState>, IList<TOut>>

Action to be executed.

formatter IValidationTextFormatter<TOut>

Validation formatter.

strict bool

Indicates if the ViewModel property to find is unique.

Returns

IValidationBinding

Returns a validation component.

Type Parameters

TView

ViewFor of ViewModel type.

TViewModel

ViewModel type.

TViewModelProperty

ViewModel property type.

TOut

Action return type.

ForProperty<TView, TViewModel, TViewModelProperty, TViewProperty>(TView, Expression<Func<TViewModel, TViewModelProperty>>, Expression<Func<TView, TViewProperty>>, IValidationTextFormatter<string>?, bool)

Creates a binding between a ViewModel property and a view property.

public static IValidationBinding ForProperty<TView, TViewModel, TViewModelProperty, TViewProperty>(TView view, Expression<Func<TViewModel, TViewModelProperty>> viewModelProperty, Expression<Func<TView, TViewProperty>> viewProperty, IValidationTextFormatter<string>? formatter = null, bool strict = true) where TView : IViewFor<TViewModel> where TViewModel : class, IReactiveObject, IValidatableViewModel

Parameters

view TView

View instance.

viewModelProperty Expression<Func<TViewModel, TViewModelProperty>>

ViewModel property.

viewProperty Expression<Func<TView, TViewProperty>>

View property.

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.

strict bool

Indicates if the ViewModel property to find is unique.

Returns

IValidationBinding

Returns a validation component.

Type Parameters

TView

ViewFor of ViewModel type.

TViewModel

ViewModel type.

TViewModelProperty

ViewModel property type.

TViewProperty

View property type.

ForValidationHelperProperty<TView, TViewModel, TOut>(TView, Expression<Func<TViewModel?, ValidationHelper?>>, Action<IValidationState, TOut>, IValidationTextFormatter<TOut>)

Creates a binding from a ValidationHelper to a specified action. Such action binding allows to easily create new and more specialized platform-specific BindValidation extension methods like those we have in ViewForExtensions targeting the Android platform.

public static IValidationBinding ForValidationHelperProperty<TView, TViewModel, TOut>(TView view, Expression<Func<TViewModel?, ValidationHelper?>> viewModelHelperProperty, Action<IValidationState, TOut> action, IValidationTextFormatter<TOut> formatter) where TView : IViewFor<TViewModel> where TViewModel : class, IReactiveObject, IValidatableViewModel

Parameters

view TView

View instance.

viewModelHelperProperty Expression<Func<TViewModel, ValidationHelper>>

ViewModel's ValidationHelper property.

action Action<IValidationState, TOut>

Action to be executed.

formatter IValidationTextFormatter<TOut>

Validation formatter.

Returns

IValidationBinding

Returns a validation component.

Type Parameters

TView

ViewFor of ViewModel type.

TViewModel

ViewModel type.

TOut

Action return type.

ForValidationHelperProperty<TView, TViewModel, TViewProperty>(TView, Expression<Func<TViewModel?, ValidationHelper?>>, Expression<Func<TView, TViewProperty>>, IValidationTextFormatter<string>?)

Creates a binding between a ValidationHelper and a specified View property.

public static IValidationBinding ForValidationHelperProperty<TView, TViewModel, TViewProperty>(TView view, Expression<Func<TViewModel?, ValidationHelper?>> viewModelHelperProperty, Expression<Func<TView, TViewProperty>> viewProperty, IValidationTextFormatter<string>? formatter = null) where TView : IViewFor<TViewModel> where TViewModel : class, IReactiveObject, IValidatableViewModel

Parameters

view TView

View instance.

viewModelHelperProperty Expression<Func<TViewModel, ValidationHelper>>

ViewModel's ValidationHelper property.

viewProperty Expression<Func<TView, TViewProperty>>

View property to bind the validation message.

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.

Returns

IValidationBinding

Returns a validation component.

Type Parameters

TView

ViewFor of ViewModel type.

TViewModel

ViewModel type.

TViewProperty

View property type.

ForViewModel<TView, TViewModel, TOut>(TView, Action<TOut>, IValidationTextFormatter<TOut>)

Creates a binding between a ViewModel and a specified action. Such action binding allows to easily create new and more specialized platform-specific BindValidation extension methods like those we have in ViewForExtensions targeting the Android platform.

public static IValidationBinding ForViewModel<TView, TViewModel, TOut>(TView view, Action<TOut> action, IValidationTextFormatter<TOut> formatter) where TView : IViewFor<TViewModel> where TViewModel : class, IReactiveObject, IValidatableViewModel

Parameters

view TView

View instance.

action Action<TOut>

Action to be executed.

formatter IValidationTextFormatter<TOut>

Validation formatter.

Returns

IValidationBinding

Returns a validation component.

Type Parameters

TView

ViewFor of ViewModel type.

TViewModel

ViewModel type.

TOut

Action return type.

ForViewModel<TView, TViewModel, TViewProperty>(TView, Expression<Func<TView, TViewProperty>>, IValidationTextFormatter<string>?)

Creates a binding between a ViewModel and a View property.

public static IValidationBinding ForViewModel<TView, TViewModel, TViewProperty>(TView view, Expression<Func<TView, TViewProperty>> viewProperty, IValidationTextFormatter<string>? formatter = null) where TView : IViewFor<TViewModel> where TViewModel : class, IReactiveObject, IValidatableViewModel

Parameters

view TView

View instance.

viewProperty Expression<Func<TView, TViewProperty>>

View property to bind the validation message.

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.

Returns

IValidationBinding

Returns a validation component.

Type Parameters

TView

ViewFor of ViewModel type.

TViewModel

ViewModel type.

TViewProperty

View property type.