# IBehavior

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

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

```rust
trait IBehavior
```

Interface implemented by all custom behaviors.

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

## Members

- [`associated_object`](#function-associated_object)
- [`attach`](#function-attach)
- [`detach`](#function-detach)

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

### associated_object

```rust
fn associated_object(self: &Self) -> Option<Ref<FerroObject>>
```

Gets the object to which the behavior is attached.

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

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

### attach

```rust
fn attach(self: &Self, associated_object: Option<Ref<FerroObject>>)
```

Attaches to the specified object.

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

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

### detach

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

Detaches this instance from its associated object.

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

## Trait implementations

- [`IBehavior`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-ibehavior/)

## Availability

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