# Interaction

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-xaml-interactivity/struct-interaction/

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

```rust
struct Interaction
```

Defines a [`BehaviorCollection`](/docs/0.5.0/api/ferroui-xaml-interactivity/struct-behaviorcollection/) attached property and provides a method for executing an
[`ActionCollection`](/docs/0.5.0/api/ferroui-xaml-interactivity/struct-actioncollection/).

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

## Members

- [`TYPE`](#assoc_const-type)
- [`behaviors_property`](#function-behaviors_property)
- [`get_behaviors`](#function-get_behaviors)
- [`set_behaviors`](#function-set_behaviors)
- [`execute_actions`](#function-execute_actions)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this type.

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

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

### behaviors_property

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

Gets or sets the `BehaviorCollection` associated with a specified object.

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

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

### get_behaviors

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

Gets the `BehaviorCollection` associated with a specified object.

A collection is created and set if the object has none: the collection of markup's
property element syntax (`<Interaction.Behaviors>`), which adds the behaviors to the
collection the getter returns.

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

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

### set_behaviors

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

Sets the `BehaviorCollection` associated with a specified object.

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

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

### execute_actions

```rust
fn execute_actions(sender: Option<&BoxedValue>, actions: Option<&ActionCollection>, parameter: Option<&BoxedValue>) -> Vec<BoxedValue>
```

Executes all actions in the `ActionCollection` and returns their results.

`sender` is passed on to the actions; the value of `parameter` is determined by the calling
behavior. Returns the results of the actions that returned one, in the order of the
actions.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)

## Availability

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