FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    MaxValueValidationRule

    struct · ferroui-xaml-interactions-custom · v0.5.0

    struct MaxValueValidationRule
    

    Validation rule that checks that a value is less than or equal to a maximum value.

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

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<MaxValueValidationRule>
    

    Returns a strong reference to this object.

    Source

    max_value_property

    fn max_value_property() -> &'static StyledProperty<Option<BoxedValue>>
    

    Identifies the MaxValue property.

    Source

    error_message_property

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

    Identifies the ErrorMessage property.

    Source

    construct

    fn construct() -> Self
    

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

    Source

    new

    fn new() -> Ref<Self>
    

    Creates a rule.

    Source

    max_value

    fn max_value(self: &Self) -> Option<BoxedValue>
    

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

    Source

    set_max_value

    fn set_max_value(self: &Self, value: Option<BoxedValue>)
    

    Source

    error_message

    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

    set_error_message

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

    Source

    validate

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

    Validates the specified value: valid when it is not null and not above the maximum.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.