RoutedEventArgs
struct · ferroui-base · v0.5.0
struct RoutedEventArgs
Provides state information and data specific to a routed event.
The routing state (handled, route, source) is mutated while the
event travels along its route, so it is interiorly mutable: handlers
receive the args by shared reference.
The args are a reference object: a copy shares the routing state with the args it was made from (marking a copy as handled marks the event as handled), and copies compare by identity. The same holds for the args types derived from this one, whose own mutable state is shared too.
Members
newwith_eventwith_event_and_sourcehandledset_handledrouted_eventset_routed_eventrouteset_routesourceset_sourceis_source
new
fn new() -> Self
Creates args with no routed event.
with_event
fn with_event<T: ?Sized>(routed_event: &RoutedEvent<T>) -> Self
Creates args for a routed event.
with_event_and_source
fn with_event_and_source<T: ?Sized>(routed_event: &RoutedEvent<T>, source: impl Into<Nullable<FerroObject>>) -> Self
Creates args for a routed event with a source.
handled
fn handled(self: &Self) -> bool
Whether the routed event has already been handled.
Once handled, the event keeps travelling along its route but is only delivered to handlers registered for handled events too.
set_handled
fn set_handled(self: &Self, value: bool)
Marks the routed event as handled or unhandled.
routed_event
fn routed_event(self: &Self) -> Option<RoutedEvent>
The routed event associated with these args.
set_routed_event
fn set_routed_event<T: ?Sized>(self: &Self, value: Option<&RoutedEvent<T>>)
Sets the routed event associated with these args.
route
fn route(self: &Self) -> RoutingStrategies
The routing strategy currently being applied to the event.
set_route
fn set_route(self: &Self, value: RoutingStrategies)
Sets the routing strategy currently being applied to the event.
source
fn source(self: &Self) -> Option<Ref<FerroObject>>
The object that raised the event.
set_source
fn set_source(self: &Self, value: impl Into<Nullable<FerroObject>>)
Sets the object that raised the event.
is_source
fn is_source(self: &Self, object: &FerroObject) -> bool
Whether object is the source of the event (C# e.Source == object).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafePropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherCloneDefaultPartialEqIRoutedEventArgs
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.