Skip to main content

FerroPropertyChangedEventArgs

Struct FerroPropertyChangedEventArgs 

Source
pub struct FerroPropertyChangedEventArgs<'a> { /* private fields */ }
Expand description

Provides information for a property change.

The values are borrowed for the duration of the notification; use the typed accessors to copy them out.

Implementations§

Source§

impl<'a> FerroPropertyChangedEventArgs<'a>

Source

pub fn sender(&self) -> &'a FerroObject

The object that the property changed on.

Source

pub fn property(&self) -> &'static FerroProperty

The property that changed.

Source

pub fn old_value(&self) -> Option<&'a dyn Any>

The old value of the property, untyped. None when only the base value changed.

Source

pub fn new_value(&self) -> &'a dyn Any

The new value of the property, untyped.

Source

pub fn priority(&self) -> BindingPriority

The priority of the binding that produced the value.

Source

pub fn is_effective_value_change(&self) -> bool

Whether the change represents a change to the effective value of the property (as opposed to a change of a lower-priority base value).

Source

pub fn get_old_value<T: Clone + 'static>(&self) -> Option<T>

Gets the old value of the property. Panics if T is not the type of the property.

Source

pub fn get_new_value<T: Clone + 'static>(&self) -> T

Gets the new value of the property. Panics if T is not the type of the property.

Source

pub fn get_old_and_new_value<T: Clone + 'static>(&self) -> (T, T)

Gets the old and new values of the property. Panics if T is not the type of the property or if there is no old value.

Source

pub fn to_owned_args(&self) -> OwnedFerroPropertyChangedEventArgs

The change held by value: the form a handler receives that cannot borrow the values (a handler attached from markup).

Trait Implementations§

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