,--1,System.Linq.Expressions.Expression})}
RuntimeCommandFallback.InvokeCommand(IObservable, TTarget?, Expression>) method¶
Defined in
Type: RuntimeCommandFallback
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 command fallback resolves the property chain by reflection.")]
public static IDisposable InvokeCommand<T, TTarget>(IObservable<T> source, TTarget? target, Expression<Func<TTarget, ICommand?>> commandProperty) where TTarget : class
Summary: Executes the command an observed property holds with each value the sequence produces.
Type parameters
| Name | Description |
|---|---|
T | The type of the value offered as the command parameter. |
TTarget | The type declaring the observed command property. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | The sequence driving the executions. |
target | TTarget? | The object declaring the command property. |
commandProperty | Expression | The property holding the command to execute. |
Returns: IDisposable -- A disposable that, when disposed, stops executing the command.
Remarks
A null target holds no property to observe, so the values are dropped rather than faulting the sequence -
the same outcome as a target whose command property is null, which is the ordinary case before a view
model is assigned.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or commandProperty is null. |