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
impl WeakEvents
Sourcepub fn collection_changed() -> Rc<WeakEvent<Rc<dyn INotifyCollectionChanged>, CollectionChange>>
pub fn collection_changed() -> Rc<WeakEvent<Rc<dyn INotifyCollectionChanged>, CollectionChange>>
Represents CollectionChanged event from INotifyCollectionChanged
Sourcepub fn thread_safe_property_changed() -> Rc<WeakEvent<Rc<dyn INotifyPropertyChanged>, str>>
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.
Sourcepub fn ferro_property_changed() -> Rc<WeakEvent<Ref<FerroObject>, FerroPropertyChangedEventArgs<'static>>>
pub fn ferro_property_changed() -> Rc<WeakEvent<Ref<FerroObject>, FerroPropertyChangedEventArgs<'static>>>
Represents PropertyChanged event from FerroObject
Sourcepub fn command_can_execute_changed() -> Rc<WeakEvent<Rc<dyn ICommand>, EventArgs>>
pub fn command_can_execute_changed() -> Rc<WeakEvent<Rc<dyn ICommand>, EventArgs>>
Represents CanExecuteChanged event from ICommand
Sourcepub fn subscribe_command_can_execute_changed<T: ObjectType>(
command: &Rc<dyn ICommand>,
subscriber: &Ref<T>,
handler: fn(&T),
) -> Rc<dyn IDisposable>
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§
impl Freeze for WeakEvents
impl RefUnwindSafe for WeakEvents
impl Send for WeakEvents
impl Sync for WeakEvents
impl Unpin for WeakEvents
impl UnsafeUnpin for WeakEvents
impl UnwindSafe for WeakEvents
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
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