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).
Members
TYPEto_refmax_value_propertyerror_message_propertyconstructnewmax_valueset_max_valueerror_messageset_error_messagevalidate
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<MaxValueValidationRule>
Returns a strong reference to this object.
max_value_property
fn max_value_property() -> &'static StyledProperty<Option<BoxedValue>>
Identifies the MaxValue property.
error_message_property
fn error_message_property() -> &'static StyledProperty<Option<String>>
Identifies the ErrorMessage property.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Creates a rule.
max_value
fn max_value(self: &Self) -> Option<BoxedValue>
Gets or sets the maximum value. This is a property of the object model.
set_max_value
fn set_max_value(self: &Self, value: Option<BoxedValue>)
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.
set_error_message
fn set_error_message(self: &Self, value: Option<String>)
validate
fn validate(self: &Self, value: Option<&BoxedValue>) -> bool
Validates the specified value: valid when it is not null and not above the maximum.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyFerroObjectImplExtClassDefaultsErasedDestructorIntoEitherDerefUpcast<T>Upcast<MaxValueValidationRule>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleFerroObjectImplIValidationRule
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.