Share via


How to: Enable a ContextMenu on a Disabled Control

This example uses the ContextMenuService to display a ContextMenu for a Button that is disabled.

Example

<Button Height="30" Content="Disabled Button" IsEnabled="False" 
     ContextMenuService.ShowOnDisabled="True">
  <Button.ContextMenu>
    <ContextMenu>
      <MenuItem Header="Item 1"/>
      <MenuItem Header="Item 2"/>
      <MenuItem Header="Item 3"/>
    </ContextMenu>
  </Button.ContextMenu>
</Button>

See Also

Concepts

ContextMenu Overview

Reference

ToolTipService