Skip to content

,--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

View source

Summary: Executes the command an observed property holds with each value the sequence produces.

Type parameters

NameDescription
TThe type of the value offered as the command parameter.
TTargetThe type declaring the observed command property.

Parameters

NameTypeDescription
sourceIObservableThe sequence driving the executions.
targetTTarget?The object declaring the command property.
commandPropertyExpression>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

TypeCondition
System.ArgumentNullExceptionsource or commandProperty is null.