# ICommandSource

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/input/trait-icommandsource/

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

```rust
trait ICommandSource
```

An interface for classes that know how to invoke a command.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_command_source.rs#L6)

## Members

- [`command`](#function-command)
- [`command_parameter`](#function-command_parameter)
- [`can_execute_changed`](#function-can_execute_changed)
- [`is_effectively_enabled`](#function-is_effectively_enabled)

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

### command

```rust
fn command(self: &Self) -> Option<Rc<dyn ICommand>>
```

The command that will be executed when the class is "invoked."
Classes that implement this interface should enable or disable based
on what the command's `can_execute` returns. The property may be
implemented as read-write if desired.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_command_source.rs#L11)

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

### command_parameter

```rust
fn command_parameter(self: &Self) -> Option<BoxedValue>
```

The parameter that will be passed to the command when executing the
command. The property may be implemented as read-write if desired.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_command_source.rs#L15)

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

### can_execute_changed

```rust
fn can_execute_changed(self: &Self)
```

Called for the `can_execute_changed` event of the command when
changes are detected.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_command_source.rs#L19)

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

### is_effectively_enabled

```rust
fn is_effectively_enabled(self: &Self) -> bool
```

Gets a value indicating whether this control and all its parents are
enabled.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_command_source.rs#L23)

## Availability

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