# MinValueValidationRule

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

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

```rust
struct MinValueValidationRule
```

Validation rule that checks that a value is greater than or equal to a minimum value.

Deviation (DEVIATIONS.md, Behaviors): the reference class is generic over the type `T` of the
value (`MinValueValidationRule<T>`, created in markup with `x:TypeArguments`); classes of the
class model are not generic, so the minimum is an untyped value, compared with the validated
value by the ordering of untyped values (`ValueTypes::compare`, which converts the minimum to
the type of the value: a minimum given as text in markup compares as a number with a number).
An unset minimum is 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/min_value_validation_rule.rs#L21)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`min_value_property`](#function-min_value_property)
- [`error_message_property`](#function-error_message_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`min_value`](#function-min_value)
- [`set_min_value`](#function-set_min_value)
- [`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/min_value_validation_rule.rs#L25)

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

### to_ref

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

Returns a strong reference to this object.

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

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

### min_value_property

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

Identifies the `MinValue` property.

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

<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/min_value_validation_rule.rs#L29)

<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/min_value_validation_rule.rs#L53)

<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/min_value_validation_rule.rs#L58)

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

### min_value

```rust
fn min_value(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/min_value_validation_rule.rs#L63)

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

### set_min_value

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



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

<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/min_value_validation_rule.rs#L73)

<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/min_value_validation_rule.rs#L77)

<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 not below the minimum.

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

## 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<MinValueValidationRule>`](/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/).
