pub struct TargetPropertyPath { /* private fields */ }Expand description
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.
Implementations§
Source§impl TargetPropertyPath
impl TargetPropertyPath
Sourcepub fn new(target: &FerroObject, property: &'static FerroProperty) -> Rc<Self>
pub 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).
Sourcepub fn target(&self) -> Option<Ref<FerroObject>>
pub fn target(&self) -> Option<Ref<FerroObject>>
The target object, if it is set and alive.
pub fn set_target(&self, value: Option<Ref<FerroObject>>)
Sourcepub fn target_name(&self) -> String
pub fn target_name(&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.
pub fn set_target_name(&self, value: impl Into<String>)
Sourcepub fn path(&self) -> String
pub fn path(&self) -> String
The text of the path of the property (Property or (Owner.Property)), as markup wrote
it.
pub fn set_path(&self, value: impl Into<String>)
Sourcepub fn property(&self) -> Option<&'static FerroProperty>
pub fn property(&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.
pub fn set_property(&self, value: Option<&'static FerroProperty>)
Trait Implementations§
Source§impl Debug for TargetPropertyPath
impl Debug for TargetPropertyPath
Source§impl Default for TargetPropertyPath
impl Default for TargetPropertyPath
Source§impl MarkupTyped for TargetPropertyPath
impl MarkupTyped for TargetPropertyPath
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
Auto Trait Implementations§
impl !Freeze for TargetPropertyPath
impl !RefUnwindSafe for TargetPropertyPath
impl !Send for TargetPropertyPath
impl !Sync for TargetPropertyPath
impl !UnwindSafe for TargetPropertyPath
impl Unpin for TargetPropertyPath
impl UnsafeUnpin for TargetPropertyPath
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more