PopupMenu.ShowForSelectionAsync Method (Rect)

Shows the context menu above the specified selection.

Syntax

public:
IAsyncOperation<IUICommand^ >^ ShowForSelectionAsync(
         Rect selection
)  

Parameters

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.

Return value

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.

Remarks

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.

Requirements

Namespace: Windows.UI.Popups

Metadata: windows.winmd

See also

Reference

PopupMenu Class

PopupMenu Members

Windows.UI.Popups Namespace