Table of Contents

Interface IPropertyBinderImplementation

Namespace
ReactiveUI
Assembly
ReactiveUI.dll

This interface represents an object that is capable of providing binding implementations.

public interface IPropertyBinderImplementation : IEnableLogger
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

BindTo<TValue, TTarget, TTValue>(IObservable<TValue>, TTarget?, Expression<Func<TTarget, TTValue?>>, object?, IBindingTypeConverter?)

BindTo takes an Observable stream and applies it to a target property. Conceptually it is similar to.

Subscribe(x =>
target.property = x)
, but allows you to use child properties without the null checks.
IDisposable BindTo<TValue, TTarget, TTValue>(IObservable<TValue> observedChange, TTarget? target, Expression<Func<TTarget, TTValue?>> propertyExpression, object? conversionHint, IBindingTypeConverter? vmToViewConverterOverride = null) where TTarget : class

Parameters

observedChange IObservable<TValue>

The target observable to bind to.

target TTarget

The target object whose property will be set.

propertyExpression Expression<Func<TTarget, TTValue>>

An expression representing the target property to set. This can be a child property (i.e. x.Foo.Bar.Baz).

conversionHint object

An object that can provide a hint for the converter. The semantics of this object is defined by the converter used.

vmToViewConverterOverride IBindingTypeConverter

An optional IBindingTypeConverter to use when converting from the viewModel to view property.

Returns

IDisposable

An object that when disposed, disconnects the binding.

Type Parameters

TValue

The value type.

TTarget

The target type.

TTValue

The target value type.

Bind<TViewModel, TView, TVMProp, TVProp, TDontCare>(TViewModel?, TView, Expression<Func<TViewModel, TVMProp?>>, Expression<Func<TView, TVProp>>, IObservable<TDontCare>?, Func<TVMProp?, TVProp>, Func<TVProp, TVMProp?>, TriggerUpdate)

Creates a two-way binding between a view model and a view. This binding will attempt to convert the values of the view and view model properties using a IBindingTypeConverter if they are not of the same type.

IReactiveBinding<TView, (object?, bool)> Bind<TViewModel, TView, TVMProp, TVProp, TDontCare>(TViewModel? viewModel, TView view, Expression<Func<TViewModel, TVMProp?>> vmProperty, Expression<Func<TView, TVProp>> viewProperty, IObservable<TDontCare>? signalViewUpdate, Func<TVMProp?, TVProp> vmToViewConverter, Func<TVProp, TVMProp?> viewToVmConverter, TriggerUpdate triggerUpdate = 0) where TViewModel : class where TView : class, IViewFor

Parameters

viewModel TViewModel

The instance of the view model object to be bound.

view TView

The instance of the view object to be bound.

vmProperty Expression<Func<TViewModel, TVMProp>>

An expression representing the property to be bound to on the view model. This can be a child property, for example x => x.Foo.Bar.Baz in which case the binding will attempt to subscribe recursively to updates in order to always get and set the correct property.

viewProperty Expression<Func<TView, TVProp>>

An expression representing the property to be bound to on the view. This can be a child property, for example x => x.Foo.Bar.Baz in which case the binding will attempt to subscribe recursively to updates in order to always get and set the correct property.

signalViewUpdate IObservable<TDontCare>

An observable, that when signaled, indicates that the view property has been changed, and that the binding should update the view model property accordingly.

vmToViewConverter Func<TVMProp, TVProp>

Delegate to convert the value of the view model's property's type to a value of the view's property's type.

viewToVmConverter Func<TVProp, TVMProp>

Delegate to convert the value of the view's property's type to a value of the view model's property's type.

triggerUpdate TriggerUpdate

The trigger update direction.

Returns

IReactiveBinding<TView, (object, bool)>

An instance of IDisposable that, when disposed, disconnects the binding.

Type Parameters

TViewModel

The type of the view model that is bound.

TView

The type of the view being bound.

TVMProp

The type of the property bound on the view model.

TVProp

The type of the property bound on the view.

TDontCare

A dummy type, only the fact that signalViewUpdate emits values is considered, not the actual values emitted.

Bind<TViewModel, TView, TVMProp, TVProp, TDontCare>(TViewModel?, TView, Expression<Func<TViewModel, TVMProp?>>, Expression<Func<TView, TVProp>>, IObservable<TDontCare>?, object?, IBindingTypeConverter?, IBindingTypeConverter?, TriggerUpdate?)

Creates a two-way binding between a view model and a view. This binding will attempt to convert the values of the view and view model properties using a IBindingTypeConverter if they are not of the same type.

IReactiveBinding<TView, (object?, bool)> Bind<TViewModel, TView, TVMProp, TVProp, TDontCare>(TViewModel? viewModel, TView view, Expression<Func<TViewModel, TVMProp?>> vmProperty, Expression<Func<TView, TVProp>> viewProperty, IObservable<TDontCare>? signalViewUpdate, object? conversionHint, IBindingTypeConverter? vmToViewConverterOverride = null, IBindingTypeConverter? viewToVMConverterOverride = null, TriggerUpdate? triggerUpdate = 0) where TViewModel : class where TView : class, IViewFor

Parameters

viewModel TViewModel

The instance of the view model object to be bound.

view TView

The instance of the view object to be bound.

vmProperty Expression<Func<TViewModel, TVMProp>>

An expression representing the property to be bound to on the view model. This can be a child property, for example x => x.Foo.Bar.Baz in which case the binding will attempt to subscribe recursively to updates in order to always get and set the correct property.

viewProperty Expression<Func<TView, TVProp>>

An expression representing the property to be bound to on the view. This can be a child property, for example x => x.Foo.Bar.Baz in which case the binding will attempt to subscribe recursively to updates in order to always get and set the correct property.

signalViewUpdate IObservable<TDontCare>

An observable, that when signaled, indicates that the view property has been changed, and that the binding should update the view model property accordingly.

conversionHint object

An object that can provide a hint for the converter. The semantics of this object is defined by the converter used.

vmToViewConverterOverride IBindingTypeConverter

An optional IBindingTypeConverter to use when converting from the viewModel to view property.

viewToVMConverterOverride IBindingTypeConverter

An optional IBindingTypeConverter to use when converting from the view to viewModel property.

triggerUpdate TriggerUpdate

The trigger update direction.

Returns

IReactiveBinding<TView, (object, bool)>

An instance of IDisposable that, when disposed, disconnects the binding.

Type Parameters

TViewModel

The type of the view model that is bound.

TView

The type of the view being bound.

TVMProp

The type of the property bound on the view model.

TVProp

The type of the property bound on the view.

TDontCare

A dummy type, only the fact that signalViewUpdate emits values is considered, not the actual values emitted.

OneWayBind<TViewModel, TView, TProp, TOut>(TViewModel?, TView, Expression<Func<TViewModel, TProp?>>, Expression<Func<TView, TOut>>, Func<TProp, TOut>)

Creates a one way binding with a selector, i.e. a binding that flows from the viewModel to the view only, and where the value of the view model property is mapped through the selector before being set to the view.

IReactiveBinding<TView, TOut> OneWayBind<TViewModel, TView, TProp, TOut>(TViewModel? viewModel, TView view, Expression<Func<TViewModel, TProp?>> vmProperty, Expression<Func<TView, TOut>> viewProperty, Func<TProp, TOut> selector) where TViewModel : class where TView : class, IViewFor

Parameters

viewModel TViewModel

The instance of the view model to bind to.

view TView

The instance of the view to bind to.

vmProperty Expression<Func<TViewModel, TProp>>

An expression representing the property to be bound to on the view model. This can be a child property, for example x => x.Foo.Bar.Baz in which case the binding will attempt to subscribe recursively to updates in order to always get the last value of the property chain.

viewProperty Expression<Func<TView, TOut>>

An expression representing the property to be bound to on the view. This can be a child property, for example x => x.Foo.Bar.Baz in which case the binding will attempt to subscribe recursively to updates in order to always set the correct property.

selector Func<TProp, TOut>

A function that will be used to transform the values of the property on the view model before being bound to the view property.

Returns

IReactiveBinding<TView, TOut>

An instance of IDisposable that, when disposed, disconnects the binding.

Type Parameters

TViewModel

The type of the view model that is bound.

TView

The type of the view that is bound.

TProp

The type of the property bound on the view model.

TOut

The return type of the selector.

OneWayBind<TViewModel, TView, TVMProp, TVProp>(TViewModel?, TView, Expression<Func<TViewModel, TVMProp?>>, Expression<Func<TView, TVProp>>, object?, IBindingTypeConverter?)

Creates a one-way binding, i.e. a binding that flows from the viewModel to the view only. This binding will attempt to convert the value of the view model property to the view property if they are not of the same type.

IReactiveBinding<TView, TVProp> OneWayBind<TViewModel, TView, TVMProp, TVProp>(TViewModel? viewModel, TView view, Expression<Func<TViewModel, TVMProp?>> vmProperty, Expression<Func<TView, TVProp>> viewProperty, object? conversionHint, IBindingTypeConverter? vmToViewConverterOverride = null) where TViewModel : class where TView : class, IViewFor

Parameters

viewModel TViewModel

The instance of the view model to bind to.

view TView

The instance of the view to bind to.

vmProperty Expression<Func<TViewModel, TVMProp>>

An expression representing the property to be bound to on the view model. This can be a child property, for example x => x.Foo.Bar.Baz in which case the binding will attempt to subscribe recursively to updates in order to always get the last value of the property chain.

viewProperty Expression<Func<TView, TVProp>>

An expression representing the property to be bound to on the view. This can be a child property, for example x => x.Foo.Bar.Baz in which case the binding will attempt to subscribe recursively to updates in order to always set the correct property.

conversionHint object

An object that can provide a hint for the converter. The semantics of this object is defined by the converter used.

vmToViewConverterOverride IBindingTypeConverter

An optional IBindingTypeConverter to use when converting from the viewModel to view property.

Returns

IReactiveBinding<TView, TVProp>

An instance of IDisposable that, when disposed, disconnects the binding.

Type Parameters

TViewModel

The type of the view model that is bound.

TView

The type of the view that is bound.

TVMProp

The type of the property bound on the view model.

TVProp

The type of the property bound on the view.

Exceptions

ArgumentException

There is no registered converter from TVMProp to TVProp.