Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ContextMenuService.IsEnabled Attached Property

Gets or sets a value that indicates whether the ContextMenu can be shown.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in PresentationFramework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

See ContextMenuService.GetIsEnabled, ContextMenuService.SetIsEnabled
See ContextMenuService.GetIsEnabled, ContextMenuService.SetIsEnabled
See ContextMenuService.GetIsEnabled, ContextMenuService.SetIsEnabled
<object ContextMenuService.IsEnabled="bool" .../>

Property Value

A Boolean value that is true if the ContextMenu is shown; false otherwise.

Identifier Field

IsEnabledProperty, registered as Attached

Metadata Flags


When the IsEnabled property is false the context menu does not appear when the user right-clicks the parent control.

The following example shows how to disable a context menu by setting the IsEnabled property to false.

<Button ContextMenuService.IsEnabled="false">
  Button with a disabled context menu
      <MenuItem Header="Item"/>

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Community Additions

© 2015 Microsoft