MenuItem.IsSubmenuOpen Property
.NET Framework 4
Gets or sets a value that indicates whether the submenu of the MenuItem is open.
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
[BrowsableAttribute(false)] [BindableAttribute(true)] public bool IsSubmenuOpen { get; set; }
<object IsSubmenuOpen="bool" .../>
Property Value
Type: System.Booleantrue if the submenu of the MenuItem is open; otherwise, false. The default is false.
The following example shows how to open a submenu of a MenuItem. In this example, the MenuItem called fileMenu contains a MenuItem called recentFiles that has a submenu. When fileMenu is opened, the SubmenuOpened event is raised and the FileMenu_Opened event handler opens the submenu of recentFiles.
<Menu> <MenuItem Name="fileMenu" Header="_File" SubmenuOpened="FileMenu_Opened"> <MenuItem Name="recentFiles" Header="Recent files"> <MenuItem Header="file 1" IsCheckable="True"/> <MenuItem Header="file 2" IsCheckable="True"/> </MenuItem> <Separator/> <MenuItem Name="closeMenu" Header="Close all Files"/> </MenuItem> </Menu>
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.