# CommandBinderService

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

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

```rust
struct CommandBinderService
```

Finds the [`ICreatesCommandBinding`](/docs/0.5.0/api/ferroui-reactiveui/binding/interfaces/trait-icreatescommandbinding/) with the highest affinity for a type of control
(`CommandBinderService`), as the property observation finds its observer.

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

## Members

- [`get_binder`](#function-get_binder)
- [`get_binder_for`](#function-get_binder_for)
- [`get_binder_above`](#function-get_binder_above)

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

### get_binder

```rust
fn get_binder<T: ?Sized + 'static>(has_event_target: bool) -> Option<Rc<dyn ICreatesCommandBinding>>
```

The registered binder with the highest positive affinity for the control type `T`; of equal
affinities the first registered wins; `None` when every binder answers zero or less
(`GetBinder<T>(bool hasEventTarget)`).

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

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

### get_binder_for

```rust
fn get_binder_for(target_type: TypeId, has_event_target: bool) -> Option<Rc<dyn ICreatesCommandBinding>>
```

`get_binder` for the control type `target_type`.

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

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

### get_binder_above

```rust
fn get_binder_above(target_type: TypeId, own_affinity: i32, has_event_target: bool) -> Option<Rc<dyn ICreatesCommandBinding>>
```

The registered binder with the highest affinity for `target_type` when it outranks
`own_affinity`, the affinity of the binding the caller would make itself
(`CommandBindingAffinityChecker.HasHigherAffinityPlugin<T>` and `GetBinder<T>`).

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`

## Availability

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