FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    CreatesCommandBindingViaEvent

    struct · ferroui-reactiveui · v0.5.0

    struct CreatesCommandBindingViaEvent<C>
    

    Binds a command to an event of a control of type C (CreatesCommandBindingViaEvent): executed with the latest command parameter each time the event is raised, if the command can execute with it.

    The events are registered by name (with_event). Without an event name, the command binds to the first of DEFAULT_COMMAND_EVENTS that is registered, then to the first registered event.

    The affinity is BindingAffinity::EXPLICIT for a named event and BindingAffinity::DEFAULT_EVENT for a default event, for a control of type C only.

    View source

    Members

    new

    fn new() -> Self
    

    A binder with no event.

    Source

    with_event

    fn with_event<A: ?Sized + 'static>(self: Self, name: impl Into<String>, event: fn(&C) -> &Event<A>) -> Self
    

    Registers the event named name that event reads from a control.

    Source

    with_event_subscription

    fn with_event_subscription(self: Self, name: impl Into<String>, subscription: ControlEventSubscription<C>) -> Self
    

    Registers the event named name that subscription adds a handler to.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • Debug
    • Default
    • ICreatesCommandBinding

    Availability

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