# InteractionTriggerBehavior

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-xaml-interactions-reactiveui/struct-interactiontriggerbehavior/

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

```rust
struct InteractionTriggerBehavior
```

A behavior that registers a handler for a ReactiveUI interaction
(`ferroui_reactiveui::Interaction`) and executes its actions when the interaction is
triggered.

The handler is registered while the associated object is in the visual tree; it executes the
actions with the associated object as the sender and the input of the interaction as the
parameter, and answers the interaction with the default output.

Deviation (DEVIATIONS.md, Behaviors): the class is not generic; the type arguments of the
reference travel with the interaction ([`AnyInteraction`](/docs/0.5.0/api/ferroui-xaml-interactions-reactiveui/struct-anyinteraction/)). The associated object is checked
to be a `Visual` on attach, as `StyledElementTrigger<Visual>` does.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/interaction_trigger_behavior.rs#L123)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`interaction_property`](#function-interaction_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`interaction`](#function-interaction)
- [`set_interaction`](#function-set_interaction)
- [`interaction_of`](#function-interaction_of)
- [`set_interaction_of`](#function-set_interaction_of)

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

### TYPE

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

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/interaction_trigger_behavior.rs#L128)

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<InteractionTriggerBehavior>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/interaction_trigger_behavior.rs#L128)

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

### interaction_property

```rust
fn interaction_property() -> &'static StyledProperty<Option<AnyInteraction>>
```

Identifies the `Interaction` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/interaction_trigger_behavior.rs#L132)

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

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/interaction_trigger_behavior.rs#L171)

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

### new

```rust
fn new() -> Ref<Self>
```

Creates the trigger.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/interaction_trigger_behavior.rs#L176)

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

### interaction

```rust
fn interaction(self: &Self) -> Option<AnyInteraction>
```

Gets or sets the interaction to register the handler for. This is a property of the
object model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/interaction_trigger_behavior.rs#L182)

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

### set_interaction

```rust
fn set_interaction(self: &Self, value: Option<AnyInteraction>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/interaction_trigger_behavior.rs#L186)

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

### interaction_of

```rust
fn interaction_of<I: 'static, O: 'static>(self: &Self) -> Option<ReactiveInteraction<I, O>>
```

The interaction, if its types are `I` and `O` (the typed `Interaction` of the reference).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/interaction_trigger_behavior.rs#L191)

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

### set_interaction_of

```rust
fn set_interaction_of<I: Clone + PartialEq + 'static, O: Clone + Default + 'static>(self: &Self, value: Option<ReactiveInteraction<I, O>>)
```

Sets the interaction from a typed one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/interaction_trigger_behavior.rs#L196)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`StyledElementBehaviorImplExt`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-styledelementbehaviorimplext/)
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<InteractionTriggerBehavior>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`StyledElementBehaviorImpl`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-styledelementbehaviorimpl/)

## Availability

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