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.
Members
new
fn new() -> Self
A binder with no event.
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.
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyDebugDefaultICreatesCommandBinding
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.