# CreatesCommandBindingViaCommandParameter

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/binding/command_binding/struct-createscommandbindingviacommandparameter/

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

```rust
struct CreatesCommandBindingViaCommandParameter<C>
```

Binds a command to a control of type `C` that has a `Command` and a `CommandParameter`
property (`CreatesCommandBindingViaCommandParameter`): the binding assigns the parameter, then
the command, and disposing it restores the values the control had.

The affinity is `BindingAffinity::EXPLICIT` for a control of type `C` when no event is named,
and zero otherwise: this binder binds no event.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/command_binding/creates_command_binding_via_command_parameter.rs#L27)

## Members

- [`new`](#function-new)

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

### new

```rust
fn new(command: PropertyPath<Rc<C>, Option<Rc<dyn ICommand>>>, set_command: impl Fn(&C, Option<Rc<dyn ICommand>>) -> () + 'static, command_parameter: PropertyPath<Rc<C>, CommandParameter>, set_command_parameter: impl Fn(&C, CommandParameter) -> () + 'static) -> Self
```

A binder over the `Command` property (`command` reads it, `set_command` assigns it) and the
`CommandParameter` property of the controls of type `C`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/command_binding/creates_command_binding_via_command_parameter.rs#L43)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `Debug`
- [`ICreatesCommandBinding`](/docs/0.5.0/api/ferroui-reactiveui/binding/interfaces/trait-icreatescommandbinding/)

## Availability

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