UIElement.ContextRequested Event


Occurs when the user has completed a context input gesture, such as a right-click.

Equivalent WinUI event: Microsoft.UI.Xaml.UIElement.ContextRequested.

// Register
event_token ContextRequested(TypedEventHandler<UIElement, ContextRequestedEventArgs const &> const& handler) const;

// Revoke with event_token
void ContextRequested(event_token const* cookie) const;

// Revoke with event_revoker
ContextRequested_revoker ContextRequested(auto_revoke_t, TypedEventHandler<UIElement, ContextRequestedEventArgs const &> const& handler) const;
public event TypedEventHandler<UIElement,ContextRequestedEventArgs> ContextRequested;
function onContextRequested(eventArgs) { /* Your code */ }
uIElement.addEventListener("contextrequested", onContextRequested);
uIElement.removeEventListener("contextrequested", onContextRequested);
- or -
uIElement.oncontextrequested = onContextRequested;
Public Custom Event ContextRequested As TypedEventHandler(Of UIElement, ContextRequestedEventArgs) 
<uiElement ContextRequested="eventhandler"/>

Event Type


Windows 10 requirements

Device family
Windows 10 Anniversary Edition (introduced in 10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v3.0)


If the ContextFlyout property is null, this event is marked as handled.

ContextRequested is a routed event. For more info on the routed event concept, see Events and routed events overview.

Applies to

See also