FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    TargetPropertyPath

    struct · ferroui-base · v0.5.0

    struct TargetPropertyPath
    

    The target of a Setter of a visual state: an object and a property of it.

    Markup writes it as the text of Setter.Target: Element.Property or Element.(Owner.Property) for an attached property. The compiler keeps the name of the element (target_name) and resolves the property against the type of the element; the property is the property of the setter. The element is found by its name in the name scope of the template or the document when the state is applied, as WinUI's CTargetPropertyPath does (m_targetName, ResolveTargetForVisualStateSetter), so a setter may name an element declared after it. An explicit target object, set in code or markup, is used instead of the name (WinUI's manual target).

    The target is held weakly: a setter of a visual state usually targets an element of the tree that holds the visual states, and so the setter would keep that tree alive.

    View source

    Members

    empty

    fn empty() -> Rc<Self>
    

    Creates a path without a target or a property.

    Source

    new

    fn new(target: &FerroObject, property: &'static FerroProperty) -> Rc<Self>
    

    Creates the path of property of target (WinUI's constructor that takes a property, with the target set).

    Source

    target

    fn target(self: &Self) -> Option<Ref<FerroObject>>
    

    The target object, if it is set and alive.

    Source

    set_target

    fn set_target(self: &Self, value: Option<Ref<FerroObject>>)
    

    Source

    target_name

    fn target_name(self: &Self) -> String
    

    The name of the target element, resolved in a name scope when the setter applies; empty when the target is an explicit object or not set.

    Source

    set_target_name

    fn set_target_name(self: &Self, value: impl Into<String>)
    

    Source

    path

    fn path(self: &Self) -> String
    

    The text of the path of the property (Property or (Owner.Property)), as markup wrote it.

    Source

    set_path

    fn set_path(self: &Self, value: impl Into<String>)
    

    Source

    property

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

    The property of the target, when the path is resolved. A setter of a visual state keeps the resolved property in its own Property.

    Source

    set_property

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

    Source

    Trait implementations

    Availability

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