# InvokeCommandExt

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/binding/mixins/trait-invokecommandext/

**trait** · [`ferroui-reactiveui`](/docs/0.5.0/api/ferroui-reactiveui/) · v0.5.0

```rust
trait InvokeCommandExt<T>
```

The `InvokeCommand` methods of `ReactiveUIBindingExtensions`, on an observable.

Deviation (DEVIATIONS.md, ReactiveUI): the overload that names the property holding the command
takes a `PropertyPath` (`prop!(VM => command)`) and is
`invoke_command_path`; upstream's generator writes its dispatch
from the lambda, and its `InvokeCommandUnsafe` reads the expression by reflection. An error of
the values is rethrown where it is raised: here it panics. The null checks of the arguments
have no counterpart.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_invoke_command.rs#L26)

## Members

- [`invoke_command`](#function-invoke_command)
- [`invoke_command_path`](#function-invoke_command_path)

<a id="function-invoke_command"></a>

### invoke_command

```rust
fn invoke_command(self: &Self, command: impl ICommand + 'static) -> Rc<dyn IDisposable>
```

Executes `command` with each value of the sequence that it can execute
(`InvokeCommand<T>(IObservable<T>, ICommand)`); disposing the result stops it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_invoke_command.rs#L29)

<a id="function-invoke_command_path"></a>

### invoke_command_path

```rust
fn invoke_command_path<V: 'static, C: ICommand + Clone + PartialEq + 'static>(self: &Self, target: Option<Rc<V>>, command_property: PropertyPath<Rc<V>, Option<C>>) -> Rc<dyn IDisposable>
```

Executes the command that `command_property` of `target` holds with each value of the
sequence, skipping a value while there is no command or it cannot execute the value; the
property is observed, so a command set later is used from then on
(`InvokeCommand<T, TTarget>(IObservable<T>, TTarget?, Expression<Func<TTarget, ICommand?>>)`).
Without a target nothing is subscribed. Disposing the result stops the executions and the
observation.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_invoke_command.rs#L37)

## Trait implementations

- [`InvokeCommandExt<T>`](/docs/0.5.0/api/ferroui-reactiveui/binding/mixins/trait-invokecommandext/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
