FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    FuncAddEventHandler

    struct · ferroui-xaml-interactivity · v0.5.0

    struct FuncAddEventHandler<TTarget, TEventArgs, TToken = std::rc::Rc<dyn IDisposable>>
    

    An IAddEventHandler for the event name of sources of type TTarget, from a function that subscribes a handler and a function that removes it.

    TTarget is the handle of the source (Ref<Button>, Rc<Model>). Deviation (DEVIATIONS.md, Behaviors): the reference removes a handler by delegate identity; a subscription of the port returns a token (TToken: a routed event handler token, a disposable), which is what remove takes.

    View source

    Members

    new

    fn new(name: &str, add: impl Fn(&TTarget, EventHandler<TEventArgs>) -> TToken + 'static, remove: impl Fn(&TTarget, TToken) -> () + 'static) -> Self
    

    Creates the handler of the event name: add subscribes a handler to a source, remove removes it with the token add returned.

    Source

    Trait implementations

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

    Availability

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