IRoutedEventArgs
trait · ferroui-base · v0.5.0
trait IRoutedEventArgs: Any
Implemented by every routed event args type.
Routed event args form a small class hierarchy rooted at
RoutedEventArgs: a derived args type embeds its base as its first
field (named base) and derefs to it. This trait gives the runtime view
of that hierarchy, so that an event raised with derived args can be
delivered to a handler written against any of its base args types.
Implement it with ferro_routed_event_args!.
Members
as_routed_event_args
fn as_routed_event_args(self: &Self) -> &RoutedEventArgs
The base routed event args: the routing state of the event.
query_args
fn query_args(self: &Self, type_id: TypeId) -> Option<&dyn Any>
Returns the args viewed as the args type identified by type_id, if
the args are of that type or of a type derived from it.
is_args_type
fn is_args_type(type_id: TypeId) -> bool
where Self: Sized
Whether this args type is the args type identified by type_id or is
derived from it.
share
fn share(self: &Self) -> Rc<dyn IRoutedEventArgs>
A shared handle to these args: what untyped code (a handler wired up
by markup) is given, since a borrow cannot be held in an untyped
value. The handle refers to the live args: the state handlers change
(handled, the source, a cancel flag, ..) is shared with them.
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.