Skip to content

,--1,System.Linq.Expressions.Expression},System.Object,ReactiveUI.Binding.Reactive.IBindingTypeConverter,System.Reactive.Concurrency.IScheduler,System.String)}

RuntimeBindingFallback.BindTo(IObservable, TTarget?, Expression>, object?, IBindingTypeConverter?, IScheduler?, string) method

Defined in

Type: RuntimeBindingFallback Namespace: ReactiveUI.Binding.Reactive.Fallback 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

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

public static IDisposable BindTo<TValue, TTarget, TTargetValue>(IObservable<TValue> source, TTarget? target, Expression<Func<TTarget, TTargetValue>> targetProperty, object? conversionHint, IBindingTypeConverter? converterOverride, IScheduler? scheduler, string bindingExpression) where TTarget : class

View source

Summary: Writes every value a sequence produces into a property, converting it on the way.

Type parameters

NameDescription
TValueThe type the sequence produces.
TTargetThe type declaring the written property.
TTargetValueThe type of the written property.

Parameters

NameTypeDescription
sourceIObservableThe sequence driving the writes.
targetTTarget?The object declaring the written property.
targetPropertyExpression>The property to write.
conversionHintobject?An optional hint handed to the converter.
converterOverride[IBindingTypeConverter?](#A converter that takes precedence over the registered ones.
scheduler[IScheduler?](#The scheduler the writes are delivered on, or null to write on the thread that owns it.
bindingExpressionstringThe bound expression, named when a write faults.

Returns: IDisposable -- A disposable that, when disposed, stops writing.

Remarks

        A value the converter refuses is written as the target type's default, which is what the generated path
        does with the same converter, so a call site behaves the same whether or not it was claimed.
        A null target holds no property to write, so the values are dropped rather than faulting the sequence.
        

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or targetProperty is null.