# DataTriggerBehavior

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

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

```rust
struct DataTriggerBehavior
```

A behavior that performs actions when the bound data meets a specified condition.

The comparison of `binding` with `value` runs in a job of the
dispatcher after one of them changed. With `revert_on_false` the
reversible actions are reverted when the condition stops being met.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/data_trigger_behavior.rs#L25)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`binding_property`](#function-binding_property)
- [`comparison_condition_property`](#function-comparison_condition_property)
- [`value_property`](#function-value_property)
- [`revert_on_false_property`](#function-revert_on_false_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`binding`](#function-binding)
- [`set_binding`](#function-set_binding)
- [`comparison_condition`](#function-comparison_condition)
- [`set_comparison_condition`](#function-set_comparison_condition)
- [`value`](#function-value)
- [`set_trigger_value`](#function-set_trigger_value)
- [`revert_on_false`](#function-revert_on_false)
- [`set_revert_on_false`](#function-set_revert_on_false)

<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/core/data_trigger_behavior.rs#L33)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/data_trigger_behavior.rs#L33)

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

### binding_property

```rust
fn binding_property() -> &'static StyledProperty<Option<BoxedValue>>
```

Identifies the `Binding` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/data_trigger_behavior.rs#L37)

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

### comparison_condition_property

```rust
fn comparison_condition_property() -> &'static StyledProperty<ComparisonConditionType>
```

Identifies the `ComparisonCondition` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/data_trigger_behavior.rs#L37)

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

### value_property

```rust
fn value_property() -> &'static StyledProperty<Option<BoxedValue>>
```

Identifies the `Value` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/data_trigger_behavior.rs#L37)

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

### revert_on_false_property

```rust
fn revert_on_false_property() -> &'static StyledProperty<bool>
```

Identifies the `RevertOnFalse` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/data_trigger_behavior.rs#L37)

<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/core/data_trigger_behavior.rs#L145)

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

### new

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

Creates a trigger.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/data_trigger_behavior.rs#L156)

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

### binding

```rust
fn binding(self: &Self) -> Option<BoxedValue>
```

Gets or sets the bound object that the trigger will listen to. This is a property of the
object model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/data_trigger_behavior.rs#L162)

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

### set_binding

```rust
fn set_binding(self: &Self, value: Option<BoxedValue>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/data_trigger_behavior.rs#L166)

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

### comparison_condition

```rust
fn comparison_condition(self: &Self) -> ComparisonConditionType
```

Gets or sets the type of comparison to be performed between `binding` and
`value`. This is a property of the object model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/data_trigger_behavior.rs#L172)

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

### set_comparison_condition

```rust
fn set_comparison_condition(self: &Self, value: ComparisonConditionType)
```



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

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

### value

```rust
fn value(self: &Self) -> Option<BoxedValue>
```

Gets or sets the value to be compared with the value of `binding`. This is
a property of the object model.

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

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

### set_trigger_value

```rust
fn set_trigger_value(self: &Self, value: Option<BoxedValue>)
```

Sets the value to be compared (named apart from the setter of every property of the object,
as the condition of the object model names its own).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/data_trigger_behavior.rs#L188)

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

### revert_on_false

```rust
fn revert_on_false(self: &Self) -> bool
```

Gets or sets a value indicating whether reversible actions should be reverted when the
condition becomes false. When false, the trigger matches the legacy semantics and only
executes actions when the condition is true.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/data_trigger_behavior.rs#L195)

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

### set_revert_on_false

```rust
fn set_revert_on_false(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/data_trigger_behavior.rs#L199)

## 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<DataTriggerBehavior>`](/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/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`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/).
