-
Notifications
You must be signed in to change notification settings - Fork 3
Context Menus
Vetle444 edited this page May 31, 2023
·
8 revisions
A context menu is a pop-up menu that provides shortcuts for actions related to the tapped item.
- Android: Menus
- iOS: Context menus
A context menu can be attached to any Element. In this example a context menu is attached to a Button with one ContextMenuItem. The ItemClickedCommand is bound to a Command, thus, when any item is tapped, the Command will be executed.
<dui:Button Text="Open context menu">
<dui:ContextMenuEffect.Menu>
<dui:ContextMenu ItemClickedCommand="{Binding ItemClickedCommand}">
<dui:ContextMenuItem Title="Tap me" />
</dui:ContextMenu>
</dui:ContextMenuEffect.Menu>
</dui:Button>There are two context menu-modes:
- Pressed (default)
- LongPressed
This mode only requires people to tap to show a context menu.
This mode requires people to long-tap the Element to show the context menu. On iOS a "preview" context menu will be used.
- Context menus can not be attached to
ToolbarItems.
Inspect the components properties class to further customize and use it.