# IPropertyBindingHook

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

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

```rust
trait IPropertyBindingHook
```

Intercepts the bindings as they are created, to run an action or to cancel the binding
(`IPropertyBindingHook`).

A hook is registered in `AppLocator` as `dyn IPropertyBindingHook` and consulted through
`BindingHooks`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/interfaces/i_property_binding_hook.rs#L17)

## Members

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

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

### execute_hook

```rust
fn execute_hook(self: &Self, source: Option<&Rc<dyn Any>>, target: &Rc<dyn Any>, get_current_view_model_properties: &dyn Fn() -> BindingHookChanges, get_current_view_properties: &dyn Fn() -> BindingHookChanges, direction: BindingDirection) -> bool
```

Called as a binding is set up, before it is wired; returns `true` to let the binding
proceed and `false` to cancel it (`ExecuteHook`).

`source` is the view model (`None` when there is none), `target` the view (not the
control); `get_current_view_model_properties` and `get_current_view_properties` read the
current values along each path when called.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/interfaces/i_property_binding_hook.rs#L24)

## Availability

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