pub struct ObjectPropertyChangedObservable { /* private fields */ }Expand description
The change notifications of one property on one object.
Returned by
get_property_changed_observable.
Change notifications borrow their values, so handlers are closures rather
than observers. The object is held weakly.
Implementations§
Source§impl ObjectPropertyChangedObservable
impl ObjectPropertyChangedObservable
Sourcepub fn subscribe(
&self,
handler: impl Fn(&FerroPropertyChangedEventArgs<'_>) + 'static,
) -> Rc<dyn IDisposable>
pub fn subscribe( &self, handler: impl Fn(&FerroPropertyChangedEventArgs<'_>) + 'static, ) -> Rc<dyn IDisposable>
Subscribes to changes of the property on the object. Disposing the returned handle unsubscribes.
Sourcepub fn add_class_handler<TTarget: ObjectType>(
&self,
handler: impl Fn(&TTarget, &FerroPropertyChangedEventArgs<'_>) + 'static,
) -> Rc<dyn IDisposable>
pub fn add_class_handler<TTarget: ObjectType>( &self, handler: impl Fn(&TTarget, &FerroPropertyChangedEventArgs<'_>) + 'static, ) -> Rc<dyn IDisposable>
Subscribes a handler that is only invoked when the object is of class
TTarget (or a class derived from it).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ObjectPropertyChangedObservable
impl !Send for ObjectPropertyChangedObservable
impl !Sync for ObjectPropertyChangedObservable
impl !UnwindSafe for ObjectPropertyChangedObservable
impl Freeze for ObjectPropertyChangedObservable
impl Unpin for ObjectPropertyChangedObservable
impl UnsafeUnpin for ObjectPropertyChangedObservable
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
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