pub struct ContextRequestedEventArgs { /* private fields */ }Expand description
Provides event data for the context requested event.
Implementations§
Source§impl ContextRequestedEventArgs
impl ContextRequestedEventArgs
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates args for a context request that has no position, e.g. one made with the keyboard.
Sourcepub fn from_pointer_event_args(pointer_event_args: &PointerEventArgs) -> Self
pub fn from_pointer_event_args(pointer_event_args: &PointerEventArgs) -> Self
Creates args for a context request made with a pointer.
Sourcepub fn from_context_requested_event_args(
context_requested_event_args: &ContextRequestedEventArgs,
) -> Self
pub fn from_context_requested_event_args( context_requested_event_args: &ContextRequestedEventArgs, ) -> Self
Creates args from other context requested args, keeping the position.
Sourcepub fn try_get_position(
&self,
relative_to: Option<&InputElement>,
) -> Option<Point>
pub fn try_get_position( &self, relative_to: Option<&InputElement>, ) -> Option<Point>
Gets the point on which the context was requested, relative to the
specified element (or to the root when None).
Returns None if the context was not requested with a pointer, e.g.
when it was requested with the keyboard.
Sourcepub fn is_holding(&self) -> bool
pub fn is_holding(&self) -> bool
Whether the context was requested by holding a pointer down.
Internal in the reference, where the controls assembly sees it.
pub fn pointer_type(&self) -> Option<PointerType>
Methods from Deref<Target = RoutedEventArgs>§
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 ContextRequestedEventArgs
impl Clone for ContextRequestedEventArgs
Source§impl Default for ContextRequestedEventArgs
impl Default for ContextRequestedEventArgs
Source§impl Deref for ContextRequestedEventArgs
impl Deref for ContextRequestedEventArgs
Source§type Target = RoutedEventArgs
type Target = RoutedEventArgs
Source§fn deref(&self) -> &RoutedEventArgs
fn deref(&self) -> &RoutedEventArgs
Source§impl IRoutedEventArgs for ContextRequestedEventArgs
impl IRoutedEventArgs for ContextRequestedEventArgs
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.Source§impl MarkupTyped for ContextRequestedEventArgs
impl MarkupTyped for ContextRequestedEventArgs
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
Auto Trait Implementations§
impl !RefUnwindSafe for ContextRequestedEventArgs
impl !Send for ContextRequestedEventArgs
impl !Sync for ContextRequestedEventArgs
impl !UnwindSafe for ContextRequestedEventArgs
impl Freeze for ContextRequestedEventArgs
impl Unpin for ContextRequestedEventArgs
impl UnsafeUnpin for ContextRequestedEventArgs
Blanket Implementations§
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