,--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
Summary: Writes every value a sequence produces into a property, converting it on the way.
Type parameters
| Name | Description |
|---|---|
TValue | The type the sequence produces. |
TTarget | The type declaring the written property. |
TTargetValue | The type of the written property. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | The sequence driving the writes. |
target | TTarget? | The object declaring the written property. |
targetProperty | Expression | The property to write. |
conversionHint | object? | 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. |
bindingExpression | string | The 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
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or targetProperty is null. |