This documentation is archived and is not being maintained.

ContextMenu.StaysOpen Property

Gets or sets a value that indicates whether the ContextMenu should close automatically.

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

[BindableAttribute(true)] 
public bool StaysOpen { get; set; }
/** @property */
public boolean get_StaysOpen ()

/** @property */
public void set_StaysOpen (boolean value)

public function get StaysOpen () : boolean

public function set StaysOpen (value : boolean)

<object StaysOpen="bool" .../>

Property Value

A Boolean value, true if the menu should stay open until the IsOpen property changes to false; otherwise false. The default value is false.

Identifier Field

StaysOpenProperty

Metadata Flags

None

The following example uses the StaysOpen property to make a context menu that will stay open until an event occurs that changes the IsOpen property to false.

<ContextMenu Name="cm" Opened="OnOpened" Closed="OnClosed" StaysOpen="true">

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