>
Defined in Type: RuntimeInteractionFallback
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 interaction fallback resolves the property chain by reflection.")]
public static IDisposable BindInteraction<TViewModel, TInput, TOutput>(TViewModel? viewModel, Expression<Func<TViewModel, IInteraction<TInput, TOutput>>> interactionProperty, Func<IInteraction<TInput, TOutput>, IDisposable> register, string bindingExpression) where TViewModel : class
Summary: Keeps a handler registered against whichever interaction the observed property holds.
Type parameters
| Name | Description |
|---|---|
TViewModel | The type declaring the interaction property. |
TInput | The type the interaction takes. |
TOutput | The type the interaction produces. |
Parameters
| Name | Type | Description |
|---|---|---|
viewModel | TViewModel? | The object declaring the interaction property. |
interactionProperty | Expression | The property holding the interaction to handle. |
register | Func | Registers the caller's handler against one interaction. |
bindingExpression | string | The bound expression, named when the observation faults. |
Returns: IDisposable -- A disposable that, when disposed, unregisters the handler and stops observing.
Remarks
The registration follows the property: replacing the interaction unregisters the handler from the one it
held before, so a view model that swaps an interaction does not leave a handler on the old one. A null view
model holds no property to observe, so nothing is registered rather than the call faulting.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | interactionProperty or register is null. |