FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    FerroProperty

    struct · ferroui-base · v0.5.0

    struct FerroProperty
    

    Base class for properties: the untyped identity and description of a property that can be set on a FerroObject.

    View source

    Members

    as_property_info

    fn as_property_info(self: &'static Self) -> std::rc::Rc<dyn IPropertyInfo>
    

    The property as a shared property description (Rc<dyn IPropertyInfo>), for the places that take a registered property through the property description contract. IPropertyInfo::as_ferro_property gives the property back.

    Source

    bind

    fn bind(self: &'static Self) -> IndexerDescriptor
    

    Gets a description of a binding to the property, for the binding indexer of FerroObject. This is the ! operator of a property: !Border.BackgroundProperty is Border::background_property().bind(), and the two-way forms !!Property and ~Property are !Property.bind().

    Source

    host_type

    fn host_type(self: &Self) -> Option<&'static TypeInfo>
    

    The class an attached property is declared for: the THost of its registration, the type of the objects its accessors (GetX/SetX) take. None for properties that are not attached.

    Source

    name

    fn name(self: &Self) -> &str
    

    The name of the property.

    Source

    property_type

    fn property_type(self: &Self) -> TypeId
    

    The type of the property's value.

    Source

    property_type_name

    fn property_type_name(self: &Self) -> &'static str
    

    The Rust type name of the property's value type.

    Source

    owner_type

    fn owner_type(self: &Self) -> &'static TypeInfo
    

    The class that registered the property.

    Source

    inherits

    fn inherits(self: &Self) -> bool
    

    Whether the property inherits its value.

    Source

    is_attached

    fn is_attached(self: &Self) -> bool
    

    Whether this is an attached property.

    Source

    is_direct

    fn is_direct(self: &Self) -> bool
    

    Whether this is a direct property.

    Source

    is_read_only

    fn is_read_only(self: &Self) -> bool
    

    Whether this is a readonly property.

    Source

    assign_binding

    fn assign_binding(self: &Self) -> bool
    

    Whether a binding given for this property in markup is assigned to the property as its value rather than bound to it (the "assign binding" attribute of the managed property). The property's value type is then a binding type. A fact about the definition: it is the same for every owner and is not part of the metadata.

    Source

    set_assign_binding

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

    Marks the property as one that bindings are assigned to. Part of the definition of the property: call it where the property is registered (styled and attached properties state it through StyledPropertyOptions::assign_binding).

    Source

    id

    fn id(self: &Self) -> u32
    

    An integer ID that uniquely identifies the property; shared by all owners added with add_owner.

    Source

    changed

    fn changed(self: &'static Self) -> &'static PropertyChangedObservable
    

    Notifications of changes to this property on any object.

    The handlers are invoked after the object's own change handling.

    Source

    get_metadata

    fn get_metadata(self: &Self, type_: &'static TypeInfo) -> FerroPropertyMetadata
    

    Gets the base metadata of the property on the specified type.

    Source

    get_metadata_for

    fn get_metadata_for(self: &Self, owner: &FerroObject) -> FerroPropertyMetadata
    

    Gets the base metadata of the property on the type of owner.

    Source

    unregister

    fn unregister(self: &Self, type_: &'static TypeInfo)
    

    Removes the metadata registered for the property on the specified type.

    Source

    is_valid_value

    fn is_valid_value(self: &Self, value: &dyn Any) -> bool
    

    Checks whether value is valid for the property: of the property's value type and accepted by its validation callback.

    Source

    as_styled

    fn as_styled<T: crate::PropertyValue>(self: &'static Self) -> Option<&'static StyledProperty<T>>
    

    The property as a styled (or attached) property with value type T: the typed view needed to read, set and bind it without boxing. None for direct properties and when T is not the property's value type.

    Source

    unset_value

    fn unset_value() -> BoxedValue
    

    The marker value that represents an unset property value.

    Source

    register

    fn register<TOwner: ObjectType, TValue: PropertyValue>(name: &str, default_value: TValue) -> &'static StyledProperty<TValue>
    

    Registers a styled property with a default value.

    Source

    register_with

    fn register_with<TOwner: ObjectType, TValue: PropertyValue>(name: &str, options: StyledPropertyOptions<TValue>) -> &'static StyledProperty<TValue>
    

    Registers a styled property.

    Source

    register_attached

    fn register_attached<TOwner: StaticType, THost: ObjectType, TValue: PropertyValue>(name: &str, default_value: TValue) -> &'static AttachedProperty<TValue>
    

    Registers an attached property with a default value.

    TOwner is the class that registers the property and THost the class of objects the property can be set on.

    Source

    register_attached_with

    fn register_attached_with<TOwner: StaticType, THost: ObjectType, TValue: PropertyValue>(name: &str, options: StyledPropertyOptions<TValue>) -> &'static AttachedProperty<TValue>
    

    Registers an attached property.

    Source

    register_direct

    fn register_direct<TOwner: ObjectType, TValue: PropertyValue>(name: &str, getter: fn(&TOwner) -> TValue, setter: Option<fn(&TOwner, TValue) -> ()>, unset_value: TValue) -> &'static DirectProperty<TOwner, TValue>
    

    Registers a direct property: a property whose value is stored in a field of the owner and accessed through a getter and setter.

    Source

    register_direct_with

    fn register_direct_with<TOwner: ObjectType, TValue: PropertyValue>(name: &str, getter: fn(&TOwner) -> TValue, setter: Option<fn(&TOwner, TValue) -> ()>, metadata: DirectPropertyMetadata<TValue>) -> &'static DirectProperty<TOwner, TValue>
    

    Registers a direct property with explicit metadata.

    Source

    Trait implementations

    Availability

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