Shows the context menu above the specified selection.
public:
IAsyncOperation<IUICommand^ >^ ShowForSelectionAsync(
Rect selection
)
selection
Type: Rect
The coordinates (in DIPs) of the selected rectangle, relative to the window. The context menu is placed directly above and centered on this rectangle such that selection is not covered.
Note
For VB, C#, and C++, this window is the CoreWindow associated with the thread that is calling the context menu.
Type: IAsyncOperation<IUICommand^ >
A IUICommand object that represents the context menu command invoked by the user, after the ShowForSelectionAsync call completes.
If no command is invoked, ShowForSelectionAsync returns null.
You can see complete code examples that demonstrate how to create and customize context menus in the Context menu sample on the Microsoft Store app sample home page.
Namespace: Windows.UI.Popups
Metadata: windows.winmd