PropertyValidationBehavior
struct · ferroui-xaml-interactions-custom · v0.5.0
struct PropertyValidationBehavior
Base behavior that validates a property value using a set of rules.
Deviation (DEVIATIONS.md, Behaviors): the reference class is generic over the type of the
associated control (TControl) and of the validated property (TValue); classes of the class
model are not generic, so both are runtime types given at creation
(new_of``::<TControl, TValue>(), construct): the associated
object is checked against the first as the reference does, and the property is validated only
when its value type is the second (Property is FerroProperty<TValue> of the reference).
The rules receive the value untyped (see IValidationRule).
Deviation (DEVIATIONS.md, Behaviors): markup cannot give a class of the object model type
arguments (x:TypeArguments="TextBox, sys:String"), so the behavior markup creates
(new) is attached to any object and validates the property
whatever the type of its value: the PropertyValidationBehavior<FerroObject, object> of the
reference, where every property is a property of object.
Members
TYPEto_refproperty_propertyis_valid_propertyerror_propertyrules_propertyconstructconstruct_untypednew_ofnewpropertyset_propertyrulesis_validset_is_validerrorset_error
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<PropertyValidationBehavior>
Returns a strong reference to this object.
property_property
fn property_property() -> &'static StyledProperty<Option<&'static FerroProperty>>
Identifies the Property property.
is_valid_property
fn is_valid_property() -> &'static StyledProperty<bool>
Identifies the IsValid property.
error_property
fn error_property() -> &'static StyledProperty<Option<String>>
Identifies the Error property.
rules_property
fn rules_property() -> &'static DirectProperty<PropertyValidationBehavior, ValidationRules>
Identifies the Rules property.
construct
fn construct(associated_type: &'static TypeInfo, value_type: TypeId) -> Self
Creates the class data of a behavior attached to objects of associated_type (the
TControl of the reference) that validates a property whose value is of type value_type
(the TValue of the reference); see ferroui_base::FerroObject::construct.
construct_untyped
fn construct_untyped() -> Self
Creates the class data of a behavior attached to any object that validates a property
whatever the type of its value (the behavior of markup, new).
new_of
fn new_of<TControl: StaticType, TValue: 'static>() -> Ref<Self>
Creates a behavior attached to objects of class TControl that validates a property whose
value is of type TValue (new PropertyValidationBehavior<TControl, TValue>()).
new
fn new() -> Ref<Self>
Creates a behavior attached to any object that validates a property whatever the type of
its value (new PropertyValidationBehavior<FerroObject, object>() of the reference, the
form markup creates: <PropertyValidationBehavior Property="{x:Static TextBox.TextProperty}">).
property
fn property(self: &Self) -> Option<&'static FerroProperty>
Gets or sets the property to validate. This is a property of the object model.
set_property
fn set_property(self: &Self, value: Option<&'static FerroProperty>)
rules
fn rules(self: &Self) -> ValidationRules
Gets validation rules collection. This is a property of the object model, and the content of the behavior in markup.
is_valid
fn is_valid(self: &Self) -> bool
Gets or sets value indicating whether the property value is valid. This is a property of the object model.
set_is_valid
fn set_is_valid(self: &Self, value: bool)
error
fn error(self: &Self) -> Option<String>
Gets or sets the validation error message. This is a property of the object model.
set_error
fn set_error(self: &Self, value: Option<String>)
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyFerroObjectImplExtStyledElementImplExtClassDefaultsErasedDestructorIntoEitherDisposingBehaviorImplExtStyledElementBehaviorImplExtDerefUpcast<T>Upcast<PropertyValidationBehavior>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleFerroObjectImplStyledElementImplDisposingBehaviorImplStyledElementBehaviorImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.