Skip to content

CommandInvoker class

Attributes: [EditorBrowsable(EditorBrowsableState.1)]

Defined in

Namespace: ReactiveUI.Binding.Reactive.CommandBinding Assembly: ReactiveUI.Binding.Reactive.dll Full name: ReactiveUI.Binding.Reactive.CommandBinding.CommandInvoker Modifiers: public static

Summary

View source

Executes a command with each value a sequence produces.

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

Remarks

What an InvokeCommand does once the command is in hand, whether the generator resolved the command property at compile time or the runtime engine read it from the expression. Both hand the command here rather than writing the gating themselves, so a generated call site emits one call and the two paths cannot drift.

CanExecute is asked at each emission rather than tracked from CanExecuteChanged: the value being offered is the command parameter, so only the command can answer for that value, and an answer tracked from the event would have to be recomputed per value anyway. A value the command refuses is dropped rather than held.

Methods

NameSummary
static InvokeExecutes one command with each value the sequence produces.
Inherited members