# RangeValidationRule

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

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

```rust
struct RangeValidationRule
```

Validation rule that checks that a value is within a range.

Deviation (DEVIATIONS.md, Behaviors): the reference class is generic over the type `T` of the
value (`RangeValidationRule<T>`, created in markup with `x:TypeArguments`); classes of the class
model are not generic, so the bounds are untyped values, compared with the validated value by
the ordering of untyped values (`ValueTypes::compare`, which converts a bound to the type of
the value). Unset bounds are null (the reference's default of a value type `T` is its zero),
and values that do not compare are not valid (the comparer of the reference throws).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/validation/rules/range_validation_rule.rs#L20)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`minimum_property`](#function-minimum_property)
- [`maximum_property`](#function-maximum_property)
- [`error_message_property`](#function-error_message_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`minimum`](#function-minimum)
- [`set_minimum`](#function-set_minimum)
- [`maximum`](#function-maximum)
- [`set_maximum`](#function-set_maximum)
- [`error_message`](#function-error_message)
- [`set_error_message`](#function-set_error_message)
- [`validate`](#function-validate)

<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.Custom/validation/rules/range_validation_rule.rs#L24)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/validation/rules/range_validation_rule.rs#L24)

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

### minimum_property

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

Identifies the `Minimum` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/validation/rules/range_validation_rule.rs#L28)

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

### maximum_property

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

Identifies the `Maximum` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/validation/rules/range_validation_rule.rs#L28)

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

### error_message_property

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

Identifies the `ErrorMessage` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/validation/rules/range_validation_rule.rs#L28)

<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.Custom/validation/rules/range_validation_rule.rs#L54)

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

### new

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

Creates a rule.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/validation/rules/range_validation_rule.rs#L59)

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

### minimum

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

Gets or sets the minimum value. This is a property of the object model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/validation/rules/range_validation_rule.rs#L64)

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

### set_minimum

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/validation/rules/range_validation_rule.rs#L68)

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

### maximum

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

Gets or sets the maximum value. This is a property of the object model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/validation/rules/range_validation_rule.rs#L73)

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

### set_maximum

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/validation/rules/range_validation_rule.rs#L77)

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

### error_message

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

Gets or sets the error message for failed validation. This is a property of the object
model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/validation/rules/range_validation_rule.rs#L83)

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

### set_error_message

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/validation/rules/range_validation_rule.rs#L87)

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

### validate

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

Validates the specified value: valid when it is not null and within the bounds.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/validation/rules/range_validation_rule.rs#L92)

## 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<RangeValidationRule>`](/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/)
- [`IValidationRule`](/docs/0.5.0/api/ferroui-xaml-interactions-custom/trait-ivalidationrule/)

## Availability

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