# FerroObjectBehaviorsExtensions

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-xaml-interactivity/trait-ferroobjectbehaviorsextensions/

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

```rust
trait FerroObjectBehaviorsExtensions
```

Surfaces `Interaction::behaviors_property` directly on `FerroObject`: the static members
`FerroObject::behaviors_property()`, `FerroObject::get_behaviors(..)` and
`FerroObject::set_behaviors(..)` when this trait is in scope.

The first use of the members adds the root object class as an owner of the attached
property (the static constructor of the reference), so that markup can name it with the
inherited syntax of a property element (`<Border.Behaviors>`).

Deviation (DEVIATIONS.md, Behaviors): the reference declares the members as extension
members of the object class (`extension(FerroObject)`); a Rust trait implemented for the
root class gives the same calls.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactivity/ferro_object_behaviors_extensions.rs#L18)

## Members

- [`behaviors_property`](#function-behaviors_property)
- [`get_behaviors`](#function-get_behaviors)
- [`set_behaviors`](#function-set_behaviors)

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

### behaviors_property

```rust
fn behaviors_property() -> &'static AttachedProperty<Option<BehaviorCollection>>
```

Exposes the behaviors attached property for consumers targeting `FerroObject`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactivity/ferro_object_behaviors_extensions.rs#L20)

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

### get_behaviors

```rust
fn get_behaviors(obj: &FerroObject) -> BehaviorCollection
```

Delegates to `Interaction::get_behaviors`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactivity/ferro_object_behaviors_extensions.rs#L23)

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

### set_behaviors

```rust
fn set_behaviors(obj: &FerroObject, value: Option<BehaviorCollection>)
```

Delegates to `Interaction::set_behaviors`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactivity/ferro_object_behaviors_extensions.rs#L26)

## Trait implementations

- [`FerroObjectBehaviorsExtensions`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-ferroobjectbehaviorsextensions/)

## Availability

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