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

PropertyBindingMixins.

Bind<TViewModel, TView, TVMProp, TVProp>(TView, TViewModel, Expression<Func<TViewModel, TVMProp>>, Expression<Func<TView, TVProp>>, object, IBindingTypeConverter, IBindingTypeConverter) Method

Summary

Binds the specified view model property to the given view property.
Namespace
ReactiveUI
Containing Type
PropertyBindingMixins

Syntax

public static IReactiveBinding<TView, (object view, bool isViewModel)> Bind<TViewModel, TView, TVMProp, TVProp>(this TView view, TViewModel viewModel, Expression<Func<TViewModel, TVMProp>> vmProperty, Expression<Func<TView, TVProp>> viewProperty, object conversionHint = null, IBindingTypeConverter vmToViewConverterOverride = null, IBindingTypeConverter viewToVMConverterOverride = null) 
    where TViewModel : class where TView : class, IViewFor

Type Parameters

Name Description
TViewModel The type of the view model being 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.

Parameters

Name Type Description
view TView The instance of the view to bind.
viewModel TViewModel The instance of the view model to bind.
vmProperty Expression<Func<TViewModel, TVMProp>> An expression indicating the property that is bound on the view model. This can be a chain of properties of the form. vm => vm.Foo.Bar.Baz and the binder will attempt to subscribe to changes on each recursively.
viewProperty Expression<Func<TView, TVProp>> The property on the view that is to be bound. This can be a chain of properties of the form. view => view.Foo.Bar.Baz and the binder will attempt to set the last one each time the view model property is updated.
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.

Return Value

Type Description
IReactiveBinding<TView, (object view, bool isViewModel)> An instance of IDisposable that, when disposed, disconnects the binding.