Skip to main content

TargetPropertyPath

Struct TargetPropertyPath 

Source
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

Source

pub fn empty() -> Rc<Self>

Creates a path without a target or a property.

Source

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

Source

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

The target object, if it is set and alive.

Source

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

Source

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.

Source

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

Source

pub fn path(&self) -> String

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

Source

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

Source

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.

Source

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

Trait Implementations§

Source§

impl Debug for TargetPropertyPath

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TargetPropertyPath

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl MarkupTyped for TargetPropertyPath

Source§

const MARKUP: &'static MarkupType

The markup metadata of the type.
Source§

impl PartialEq for TargetPropertyPath

Compares by identity (reference equality), as the reference type this mirrors.

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyValue for T
where T: PartialEq + 'static,

Source§

fn any_value_as_any(&self) -> &(dyn Any + 'static)

Source§

fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool

Source§

fn any_value_type_name(&self) -> &'static str

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.