# Condition

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

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

```rust
struct Condition
```

Represents a reusable comparison that can be used by triggers and behaviors.

The left operand is either the value of a `binding` (the binding itself is
assigned to the property, then bound by the condition) or of a `property`
of a source; the right operand is `value`.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`binding_property`](#function-binding_property)
- [`binding_value_property`](#function-binding_value_property)
- [`comparison_condition_property`](#function-comparison_condition_property)
- [`value_property`](#function-value_property)
- [`property_property`](#function-property_property)
- [`source_name_property`](#function-source_name_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_condition_value`](#function-set_condition_value)
- [`property`](#function-property)
- [`set_property`](#function-set_property)
- [`source_name`](#function-source_name)
- [`set_source_name`](#function-set_source_name)
- [`binding_value`](#function-binding_value)
- [`set_binding_value`](#function-set_binding_value)

<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.Interactivity/core/condition.rs#L24)

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

### to_ref

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

Returns a strong reference to this object.

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

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

### binding_property

```rust
fn binding_property() -> &'static StyledProperty<Option<Rc<dyn BindingBase>>>
```

Identifies the `Binding` property.

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

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

### binding_value_property

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

Identifies the `BindingValue` property (internal in the reference): the value of the
binding.

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

<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.Interactivity/core/condition.rs#L34)

<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.Interactivity/core/condition.rs#L34)

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

### property_property

```rust
fn property_property() -> &'static StyledProperty<Option<&'static FerroProperty>>
```

Identifies the `Property` property.

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

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

### source_name_property

```rust
fn source_name_property() -> &'static StyledProperty<Option<String>>
```

Identifies the `SourceName` property.

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

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

### construct

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

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

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

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

### new

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

Creates a condition.

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

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

### binding

```rust
fn binding(self: &Self) -> Option<Rc<dyn BindingBase>>
```

Gets or sets the bound object to compare. This is a property of the object model, to which
markup assigns a binding as it is.

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

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

### set_binding

```rust
fn set_binding(self: &Self, value: Option<Rc<dyn BindingBase>>)
```



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

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

### comparison_condition

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

Gets or sets the type of comparison that is performed.

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

<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.Interactivity/core/condition.rs#L130)

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

### value

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

Gets or sets the value that is used during comparison.

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

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

### set_condition_value

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

Sets the value that is used during comparison (named apart from the setter of every
property of the object, as the range controls of the framework name theirs).

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

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

### property

```rust
fn property(self: &Self) -> Option<&'static FerroProperty>
```

Gets or sets the property that will be monitored for changes.

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

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

### set_property

```rust
fn set_property(self: &Self, value: Option<&'static FerroProperty>)
```



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

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

### source_name

```rust
fn source_name(self: &Self) -> Option<String>
```

Gets or sets the name of the element that supplies `property`. When
null, the associated object is used.

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

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

### set_source_name

```rust
fn set_source_name(self: &Self, value: Option<String>)
```



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

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

### binding_value

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

The value of the binding (internal in the reference).

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

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

### set_binding_value

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



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

## 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/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<Condition>`](/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/)

## Availability

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