Live Chat Icon For mobile
Live Chat Icon

How can I enable a Context Menu on a disabled Control ?

Platform: WPF| Category: Context Menu

This example uses the ContextMenuService.ShowOnDisabled property to show the context menu for a disabled button.

[XAML]

<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>

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.