Skip to main content

WeakEvents

Struct WeakEvents 

Source
pub struct WeakEvents;
Expand description

The weak events of the framework’s notification contracts.

Each event is a per-thread static, as everything the event refers to belongs to one thread; an accessor returns the event of the calling thread.

Implementations§

Source§

impl WeakEvents

Source

pub fn collection_changed() -> Rc<WeakEvent<Rc<dyn INotifyCollectionChanged>, CollectionChange>>

Represents CollectionChanged event from INotifyCollectionChanged

Source

pub fn thread_safe_property_changed() -> Rc<WeakEvent<Rc<dyn INotifyPropertyChanged>, str>>

Represents PropertyChanged event from INotifyPropertyChanged with auto-dispatching to the UI thread.

A model object is bound to the thread it was created on (it is held through Rc), so its notifications are raised on that thread and are forwarded there directly.

Source

pub fn ferro_property_changed() -> Rc<WeakEvent<Ref<FerroObject>, FerroPropertyChangedEventArgs<'static>>>

Represents PropertyChanged event from FerroObject

Source

pub fn command_can_execute_changed() -> Rc<WeakEvent<Rc<dyn ICommand>, EventArgs>>

Represents CanExecuteChanged event from ICommand

Source

pub fn subscribe_command_can_execute_changed<T: ObjectType>( command: &Rc<dyn ICommand>, subscriber: &Ref<T>, handler: fn(&T), ) -> Rc<dyn IDisposable>

Subscribes subscriber to the “can execute changed” event of command. handler is called with the subscriber each time the event is raised.

Not in the original: the command sources (button, menu item, split button, native menu item) subscribe through this handle-based form.

The subscriber keeps the returned handle (normally in a field). The subscription ends when the handle is disposed, when the handle is dropped (so with the subscriber), or, if the handle is kept alive elsewhere, the first time the event is raised after the subscriber is gone. The command never holds a strong reference to the subscriber.

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.