Skip to content

},System.Linq.Expressions.Expression{System.Func{--0,--3}},System.Func{--2,--3},System.Func{--3,--2},System.Reactive.Concurrency.IScheduler)} },System.Linq.Expressions.Expression{System.Func{--0,--3}},ReactiveUI.Binding.Reactive.IBindingTypeConverter,ReactiveUI.Binding.Reactive.IBindingTypeConverter,System.Reactive.Concurrency.IScheduler,System.Object)}

ReactiveSchedulerExtensions.BindUnsafe(TView, TViewModel, Expression>, Expression>, Func, Func, IScheduler?) method

Defined in

Type: ReactiveSchedulerExtensions Namespace: ReactiveUI.Binding.Reactive Assembly: ReactiveUI.Binding.Reactive.dll

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-tvos18.0, net9.0-maccatalyst18.0, net9.0-ios18.0, net9.0-macos15.0, net9.0-desktop1.0, net8.0, net8.0-macos14.5, net8.0-ios18.0, net8.0-maccatalyst18.0, net8.0-macos15.0, net8.0-tvos18.0, net8.0-ios17.5, net8.0-maccatalyst17.5, netstandard2.1, net481, net462, net471

Overloads

  • 1. public static IReactiveBinding<TView, BindingChange> BindUnsafe<TView, TViewModel, TVMProp, TVProp>(this TView view, TViewModel viewModel, Expression<Func<TViewModel, TVMProp>> viewModelProperty, Expression<Func<TView, TVProp>> viewProperty, Func<TVMProp, TVProp> viewModelToViewConverter, Func<TVProp, TVMProp> viewToViewModelConverter, IScheduler? scheduler) where TView : class, IViewFor where TViewModel : class
  • 2. public static IReactiveBinding<TView, BindingChange> BindUnsafe<TView, TViewModel, TVMProp, TVProp>(this TView view, TViewModel viewModel, Expression<Func<TViewModel, TVMProp>> viewModelProperty, Expression<Func<TView, TVProp>> viewProperty, IBindingTypeConverter viewModelToViewConverter, IBindingTypeConverter viewToViewModelConverter, IScheduler? scheduler, object? conversionHint) where TView : class, IViewFor where TViewModel : class

1. Overload

Attributes: [RequiresUnreferencedCode("Runtime binding fallback resolves the property chain by reflection.")]

public static IReactiveBinding<TView, BindingChange> BindUnsafe<TView, TViewModel, TVMProp, TVProp>(this TView view, TViewModel viewModel, Expression<Func<TViewModel, TVMProp>> viewModelProperty, Expression<Func<TView, TVProp>> viewProperty, Func<TVMProp, TVProp> viewModelToViewConverter, Func<TVProp, TVMProp> viewToViewModelConverter, IScheduler? scheduler) where TView : class, IViewFor where TViewModel : class

View source

Summary: Creates a two-way binding between a view model property and a view property with conversion functions and a specified scheduler.

Type parameters

NameDescription
TViewThe type of the view.
TViewModelThe type of the view model.
TVMPropThe type of the view model property.
TVPropThe type of the view property.

Parameters

NameTypeDescription
viewTViewThe view the binding is rooted on.
viewModelTViewModelThe view model to observe.
viewModelPropertyExpression>An expression that selects the view model property to observe.
viewPropertyExpression>An expression that selects the view property to update.
viewModelToViewConverterFuncA function that converts the view model property value to the view property type.
viewToViewModelConverterFuncA function that converts the view property value back to the view model property type.
scheduler[IScheduler?](#The scheduler to use for the binding.

Returns: IReactiveBinding -- A reactive binding that can be disposed to disconnect the binding.

Remarks

Resolves the property chain by reflection, for an expression the generator could not read.

2. Overload

Attributes: [RequiresUnreferencedCode("Runtime binding fallback resolves the property chain by reflection.")]

public static IReactiveBinding<TView, BindingChange> BindUnsafe<TView, TViewModel, TVMProp, TVProp>(this TView view, TViewModel viewModel, Expression<Func<TViewModel, TVMProp>> viewModelProperty, Expression<Func<TView, TVProp>> viewProperty, IBindingTypeConverter viewModelToViewConverter, IBindingTypeConverter viewToViewModelConverter, IScheduler? scheduler, object? conversionHint) where TView : class, IViewFor where TViewModel : class

View source

Summary: Creates a two-way binding between a view model property and a view property using explicit IBindingTypeConverter instances.

Type parameters

NameDescription
TViewThe type of the view.
TViewModelThe type of the view model.
TVMPropThe type of the view model property.
TVPropThe type of the view property.

Parameters

NameTypeDescription
viewTViewThe view the binding is rooted on.
viewModelTViewModelThe view model to observe.
viewModelPropertyExpression>An expression that selects the view model property to observe.
viewPropertyExpression>An expression that selects the view property to update.
viewModelToViewConverter[IBindingTypeConverter](#The converter for view model-to-view conversion.
viewToViewModelConverter[IBindingTypeConverter](#The converter for view-to-view model conversion.
scheduler[IScheduler?](#The scheduler to use for the binding.
conversionHintobject?An optional hint passed to the converters (e.g., format string).

Returns: IReactiveBinding -- A reactive binding that can be disposed to disconnect the binding.

Remarks

Resolves the property chain by reflection, for an expression the generator could not read.