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.
Members
empty
fn empty() -> Rc<Self>
Creates a path without a target or a property.
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).
target
fn target(self: &Self) -> Option<Ref<FerroObject>>
The target object, if it is set and alive.
set_target
fn set_target(self: &Self, value: Option<Ref<FerroObject>>)
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.
set_target_name
fn set_target_name(self: &Self, value: impl Into<String>)
path
fn path(self: &Self) -> String
The text of the path of the property (Property or (Owner.Property)), as markup wrote
it.
set_path
fn set_path(self: &Self, value: impl Into<String>)
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.
set_property
fn set_property(self: &Self, value: Option<&'static FerroProperty>)
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeAnyValueClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherDefaultPartialEqDebugMarkupTypedValueTypeRegistration
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.