Skip to content

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

ReactiveSchedulerExtensions.OneWayBind(TView, TViewModel, Expression>, Expression>, Func, IScheduler?, string, string, string, int) method

Defined in

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

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481, net471

Overloads

  • 1. public static IReactiveBinding<TView, TOut> OneWayBind<TViewModel, TView, TProp, TOut>(this TView view, TViewModel viewModel, Expression<Func<TViewModel, TProp>> vmProperty, Expression<Func<TView, TOut>> viewProperty, Func<TProp, TOut> selector, IScheduler? scheduler, string vmPropertyExpression = "", string viewPropertyExpression = "", string callerFilePath = "", int callerLineNumber = 0) where TViewModel : class where TView : class, IViewFor
  • 2. public static IReactiveBinding<TView, TVProp> OneWayBind<TViewModel, TView, TVMProp, TVProp>(this TView view, TViewModel viewModel, Expression<Func<TViewModel, TVMProp>> vmProperty, Expression<Func<TView, TVProp>> viewProperty, IBindingTypeConverter converter, object? conversionHint = null, IScheduler? scheduler = null, string callerFilePath = "", int callerLineNumber = 0) where TViewModel : class where TView : class, IViewFor

1. Overload

public static IReactiveBinding<TView, TOut> OneWayBind<TViewModel, TView, TProp, TOut>(this TView view, TViewModel viewModel, Expression<Func<TViewModel, TProp>> vmProperty, Expression<Func<TView, TOut>> viewProperty, Func<TProp, TOut> selector, IScheduler? scheduler, string vmPropertyExpression = "", string viewPropertyExpression = "", string callerFilePath = "", int callerLineNumber = 0) where TViewModel : class where TView : class, IViewFor

View source

Summary: Creates a one-way binding from a view model property to a view property with a specified selector and scheduler.

Type parameters

NameDescription
TViewModelThe type of the view model.
TViewThe type of the view.
TPropThe type of the view model property.
TOutThe type of the view property.

Parameters

NameTypeDescription
viewTViewThe view to bind to.
viewModelTViewModelThe view model to observe.
vmPropertyExpression>An expression that selects the view model property to observe.
viewPropertyExpression>An expression that selects the view property to update.
selectorFuncA function that converts the view model property value to the view property type.
scheduler[IScheduler?](#The scheduler to use for the binding.
vmPropertyExpression = ""stringThe caller argument expression for vmProperty. Auto-populated by the compiler.
viewPropertyExpression = ""stringThe caller argument expression for viewProperty. Auto-populated by the compiler.
callerFilePath = ""stringThe source file path of the caller. Auto-populated by the compiler.
callerLineNumber = 0intThe source line number of the caller. Auto-populated by the compiler.

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

2. Overload

public static IReactiveBinding<TView, TVProp> OneWayBind<TViewModel, TView, TVMProp, TVProp>(this TView view, TViewModel viewModel, Expression<Func<TViewModel, TVMProp>> vmProperty, Expression<Func<TView, TVProp>> viewProperty, IBindingTypeConverter converter, object? conversionHint = null, IScheduler? scheduler = null, string callerFilePath = "", int callerLineNumber = 0) where TViewModel : class where TView : class, IViewFor

View source

Summary: Creates a one-way binding from a view model property to a view property using an explicit IBindingTypeConverter.

Type parameters

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

Parameters

NameTypeDescription
viewTViewThe view to bind to.
viewModelTViewModelThe view model to observe.
vmPropertyExpression>An expression that selects the view model property to observe.
viewPropertyExpression>An expression that selects the view property to update.
converter[IBindingTypeConverter](#The binding type converter to use for converting between source and target types.
conversionHint = nullobject?An optional hint passed to the converter (e.g., format string).
scheduler = null[IScheduler?](#The scheduler to use for the binding.
callerFilePath = ""stringThe source file path of the caller. Auto-populated by the compiler.
callerLineNumber = 0intThe source line number of the caller. Auto-populated by the compiler.

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