Export (0) Print
Expand All

FrameworkContentElement.ContextMenu Property

Gets or sets the context menu element that should appear whenever the context menu is requested via user interface (UI) from within this element. This is a dependency property.

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

public ContextMenu ContextMenu { get; set; }
/** @property */
public ContextMenu get_ContextMenu ()

/** @property */
public void set_ContextMenu (ContextMenu value)

public function get ContextMenu () : ContextMenu

public function set ContextMenu (value : ContextMenu)

<object>
  <object.ContextMenu>
    <ContextMenu .../>
  </object.ContextMenu>
</object>

Property Value

The context menu that this element uses.

Identifier field

ContextMenuProperty

Metadata properties set to true

None

The following example places a ContextMenu on a Paragraph.

<Paragraph>Lorem ipsum etc.
  <Paragraph.ContextMenu>
    <ContextMenu Name="cm">
      <MenuItem Header="Edit"/>
      <MenuItem Header="Print"/>
    </ContextMenu>
  </Paragraph.ContextMenu>
</Paragraph>

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.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft