FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    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<PropertyValidationBehavior>
    

    Returns a strong reference to this object.

    Source

    property_property

    fn property_property() -> &'static StyledProperty<Option<&'static FerroProperty>>
    

    Identifies the Property property.

    Source

    is_valid_property

    fn is_valid_property() -> &'static StyledProperty<bool>
    

    Identifies the IsValid property.

    Source

    error_property

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

    Identifies the Error property.

    Source

    rules_property

    fn rules_property() -> &'static DirectProperty<PropertyValidationBehavior, ValidationRules>
    

    Identifies the Rules property.

    Source

    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.

    Source

    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).

    Source

    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>()).

    Source

    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}">).

    Source

    property

    fn property(self: &Self) -> Option<&'static FerroProperty>
    

    Gets or sets the property to validate. This is a property of the object model.

    Source

    set_property

    fn set_property(self: &Self, value: Option<&'static FerroProperty>)
    

    Source

    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.

    Source

    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.

    Source

    set_is_valid

    fn set_is_valid(self: &Self, value: bool)
    

    Source

    error

    fn error(self: &Self) -> Option<String>
    

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

    Source

    set_error

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

    Source

    Trait implementations

    Availability

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