pub struct RoutedEventArgs { /* private fields */ }Expand description
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.
Implementations§
Source§impl RoutedEventArgs
impl RoutedEventArgs
Sourcepub fn with_event<T: ?Sized>(routed_event: &RoutedEvent<T>) -> Self
pub fn with_event<T: ?Sized>(routed_event: &RoutedEvent<T>) -> Self
Creates args for a routed event.
Sourcepub fn with_event_and_source<T: ?Sized>(
routed_event: &RoutedEvent<T>,
source: impl Into<Nullable<FerroObject>>,
) -> Self
pub 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.
Sourcepub fn handled(&self) -> bool
pub fn handled(&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.
Sourcepub fn set_handled(&self, value: bool)
pub fn set_handled(&self, value: bool)
Marks the routed event as handled or unhandled.
Sourcepub fn routed_event(&self) -> Option<RoutedEvent>
pub fn routed_event(&self) -> Option<RoutedEvent>
The routed event associated with these args.
Sourcepub fn set_routed_event<T: ?Sized>(&self, value: Option<&RoutedEvent<T>>)
pub fn set_routed_event<T: ?Sized>(&self, value: Option<&RoutedEvent<T>>)
Sets the routed event associated with these args.
Sourcepub fn route(&self) -> RoutingStrategies
pub fn route(&self) -> RoutingStrategies
The routing strategy currently being applied to the event.
Sourcepub fn set_route(&self, value: RoutingStrategies)
pub fn set_route(&self, value: RoutingStrategies)
Sets the routing strategy currently being applied to the event.
Sourcepub fn source(&self) -> Option<Ref<FerroObject>>
pub fn source(&self) -> Option<Ref<FerroObject>>
The object that raised the event.
Sourcepub fn set_source(&self, value: impl Into<Nullable<FerroObject>>)
pub fn set_source(&self, value: impl Into<Nullable<FerroObject>>)
Sets the object that raised the event.
Sourcepub fn is_source(&self, object: &FerroObject) -> bool
pub fn is_source(&self, object: &FerroObject) -> bool
Whether object is the source of the event (C# e.Source == object).
Trait Implementations§
Source§impl Clone for RoutedEventArgs
impl Clone for RoutedEventArgs
Source§impl Default for RoutedEventArgs
impl Default for RoutedEventArgs
Source§impl IRoutedEventArgs for RoutedEventArgs
impl IRoutedEventArgs for RoutedEventArgs
Source§fn as_routed_event_args(&self) -> &RoutedEventArgs
fn as_routed_event_args(&self) -> &RoutedEventArgs
Source§fn query_args(&self, type_id: TypeId) -> Option<&dyn Any>
fn query_args(&self, type_id: TypeId) -> Option<&dyn Any>
type_id, if
the args are of that type or of a type derived from it.Source§fn is_args_type(type_id: TypeId) -> bool
fn is_args_type(type_id: TypeId) -> bool
type_id or is
derived from it.handled, the source, a cancel flag, ..) is shared with them.Auto Trait Implementations§
impl !RefUnwindSafe for RoutedEventArgs
impl !Send for RoutedEventArgs
impl !Sync for RoutedEventArgs
impl !UnwindSafe for RoutedEventArgs
impl Freeze for RoutedEventArgs
impl Unpin for RoutedEventArgs
impl UnsafeUnpin for RoutedEventArgs
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more