Skip to main content

ContextMenu

Description​

Use ContextMenu for actions that apply to a selected item or region.

The images show the open menu. A closed context menu has no visible surface.

ContextMenu in light mode ContextMenu in dark mode

Example usage​

<fluence:Button Content="Open context menu">
<fluence:Button.ContextMenu>
<fluence:ContextMenu>
<fluence:MenuItem Header="Copy" />
</fluence:ContextMenu>
</fluence:Button.ContextMenu>
</fluence:Button>

Key properties​

PropertyDefaultPurpose
ItemsEmpty collection (WPF default)Menu items displayed in the popup.
IsOpenfalse (WPF default)Controls whether the menu is open.
PlacementTargetnull (WPF default)Element used to position the popup.

State and behavior​

The menu opens at the target and closes after a command or light dismissal.

Events​

The inherited Opened and Closed events report popup state changes.

Reference​