FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    WeakEvents

    struct · ferroui-base · v0.5.0

    struct WeakEvents
    

    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.

    View source

    Members

    collection_changed

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

    Represents CollectionChanged event from INotifyCollectionChanged

    Source

    thread_safe_property_changed

    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

    ferro_property_changed

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

    Represents PropertyChanged event from FerroObject

    Source

    command_can_execute_changed

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

    Represents CanExecuteChanged event from ICommand

    Source

    subscribe_command_can_execute_changed

    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.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.