},System.Linq.Expressions.Expression{System.Func{--1,--3}},System.Object,ReactiveUI.IBindingTypeConverter,ReactiveUI.IBindingTypeConverter)} },System.Linq.Expressions.Expression{System.Func{--1,--3}},System.IObservable{--4},System.Object,ReactiveUI.IBindingTypeConverter,ReactiveUI.IBindingTypeConverter,ReactiveUI.TriggerUpdate)} },System.Linq.Expressions.Expression{System.Func{--1,--3}},System.Func{--2,--3},System.Func{--3,--2})} },System.Linq.Expressions.Expression{System.Func{--1,--3}},System.IObservable{--4},System.Func{--2,--3},System.Func{--3,--2},ReactiveUI.TriggerUpdate)}
PropertyBindingMixins.Bind(TView, TViewModel?, Expression>, Expression>, object?, IBindingTypeConverter?, IBindingTypeConverter?) method¶
Defined in
Type: PropertyBindingMixins
Namespace: ReactiveUI
Assembly: ReactiveUI.dll
Applies to
net10.0, net10.0-android36.0, net10.0-ios26.0, net10.0-macos26.0, net10.0-windows10.0.19041, net10.0-tvos26.0, net10.0-maccatalyst26.0, net10.0-desktop1.0, net10.0-browserwasm1.0, net9.0, net9.0-tvos18.0, net9.0-maccatalyst18.0, net9.0-windows10.0.19041, net9.0-desktop1.0, net9.0-browserwasm1.0, net9.0-macos15.0, net9.0-ios18.0, net9.0-android35.0, net8.0, net8.0-macos14.5, net8.0-macos14.2, net8.0-maccatalyst17.5, net8.0-ios17.5, net8.0-tvos18.0, net8.0-macos15.0, net8.0-ios18.0, net8.0-windows10.0.19041, net8.0-maccatalyst18.0, net8.0-tvos17.2, netstandard2.1, net481, net462
Overloads¶
- 1.
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 - 2.
public static IReactiveBinding<TView, (object? view, bool isViewModel)> Bind<TViewModel, TView, TVMProp, TVProp, TDontCare>(this TView view, TViewModel? viewModel, Expression<Func<TViewModel, TVMProp?>> vmProperty, Expression<Func<TView, TVProp>> viewProperty, IObservable<TDontCare>? signalViewUpdate, object? conversionHint = null, IBindingTypeConverter? vmToViewConverterOverride = null, IBindingTypeConverter? viewToVMConverterOverride = null, TriggerUpdate triggerUpdate = ViewToViewModel) where TViewModel : class where TView : class, IViewFor - 3.
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, Func<TVMProp?, TVProp> vmToViewConverter, Func<TVProp, TVMProp?> viewToVmConverter) where TViewModel : class where TView : class, IViewFor - 4.
public static IReactiveBinding<TView, (object? view, bool isViewModel)> Bind<TViewModel, TView, TVMProp, TVProp, TDontCare>(this TView view, TViewModel? viewModel, Expression<Func<TViewModel, TVMProp?>> vmProperty, Expression<Func<TView, TVProp>> viewProperty, IObservable<TDontCare>? signalViewUpdate, Func<TVMProp?, TVProp> vmToViewConverter, Func<TVProp, TVMProp?> viewToVmConverter, TriggerUpdate triggerUpdate = ViewToViewModel) where TViewModel : class where TView : class, IViewFor
1. Overload¶
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
Summary: Binds the specified view model property to the given view property.
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 | 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 | 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 = null | object? | An object that can provide a hint for the converter. The semantics of this object is defined by the converter used. |
vmToViewConverterOverride = null | [IBindingTypeConverter?](# | An optional [IBindingTypeConverter](# to use when converting from the viewModel to view property. |
viewToVMConverterOverride = null | [IBindingTypeConverter?](# | An optional [IBindingTypeConverter](# to use when converting from the view to viewModel property. |
Returns: IReactiveBinding
2. Overload¶
public static IReactiveBinding<TView, (object? view, bool isViewModel)> Bind<TViewModel, TView, TVMProp, TVProp, TDontCare>(this TView view, TViewModel? viewModel, Expression<Func<TViewModel, TVMProp?>> vmProperty, Expression<Func<TView, TVProp>> viewProperty, IObservable<TDontCare>? signalViewUpdate, object? conversionHint = null, IBindingTypeConverter? vmToViewConverterOverride = null, IBindingTypeConverter? viewToVMConverterOverride = null, TriggerUpdate triggerUpdate = ViewToViewModel) where TViewModel : class where TView : class, IViewFor
Summary: Binds the specified view model property to the given view property, and provide a custom view update signaller to signal when the view property has been updated.
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. |
TDontCare | A dummy type, only the fact that signalViewUpdate emits values is considered, not the actual values emitted. |
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 | 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 | 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. |
signalViewUpdate | IObservable | 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 = null | object? | An object that can provide a hint for the converter. The semantics of this object is defined by the converter used. |
vmToViewConverterOverride = null | [IBindingTypeConverter?](# | An optional [IBindingTypeConverter](# to use when converting from the viewModel to view property. |
viewToVMConverterOverride = null | [IBindingTypeConverter?](# | An optional [IBindingTypeConverter](# to use when converting from the view to viewModel property. |
triggerUpdate = 0 | [TriggerUpdate](# | The trigger update direction. |
Returns: IReactiveBinding
3. Overload¶
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, Func<TVMProp?, TVProp> vmToViewConverter, Func<TVProp, TVMProp?> viewToVmConverter) where TViewModel : class where TView : class, IViewFor
Summary: Binds the specified view model property to the given view property.
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 | 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 | 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. |
vmToViewConverter | Func | 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 | Delegate to convert the value of the view's property's type to a value of the view model's property's type. |
Returns: IReactiveBinding
4. Overload¶
public static IReactiveBinding<TView, (object? view, bool isViewModel)> Bind<TViewModel, TView, TVMProp, TVProp, TDontCare>(this TView view, TViewModel? viewModel, Expression<Func<TViewModel, TVMProp?>> vmProperty, Expression<Func<TView, TVProp>> viewProperty, IObservable<TDontCare>? signalViewUpdate, Func<TVMProp?, TVProp> vmToViewConverter, Func<TVProp, TVMProp?> viewToVmConverter, TriggerUpdate triggerUpdate = ViewToViewModel) where TViewModel : class where TView : class, IViewFor
Summary: Binds the specified view model property to the given view property.
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. |
TDontCare | A dummy type, only the fact that signalViewUpdate emits values is considered, not the actual values emitted. |
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 | 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 | 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. |
signalViewUpdate | IObservable | 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 | 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 | Delegate to convert the value of the view's property's type to a value of the view model's property's type. |
triggerUpdate = 0 | [TriggerUpdate](# | The trigger update direction. |
Returns: IReactiveBinding