Edit

Share via


MenuItem Class

Definition

Caution

This control will be removed in a future major release. Please use the MenuBar control from the WinUI Library instead.

Menu Item is the items main container for Class Menu control

[System.Obsolete("This control will be removed in a future major release. Please use the MenuBar control from the WinUI Library instead.")]
public class MenuItem : Microsoft.UI.Xaml.Controls.ItemsControl
[<System.Obsolete("This control will be removed in a future major release. Please use the MenuBar control from the WinUI Library instead.")>]
type MenuItem = class
    inherit ItemsControl
Public Class MenuItem
Inherits ItemsControl
Inheritance
Microsoft.UI.Xaml.Controls.ItemsControl
MenuItem
Attributes

Constructors

MenuItem()

Initializes a new instance of the MenuItem class.

Fields

HeaderProperty

Identifies the Header dependency property.

HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.

Properties

Header

Gets or sets the header of each control.

HeaderTemplate

Gets or sets the template used to display the content of the control's header.

IsOpened

Gets a value indicating whether the menu is opened or not

Methods

HideMenu()

This method is used to hide the menu for current item

OnApplyTemplate() Microsoft.UI.Xaml.Controls.ItemsControl.OnApplyTemplate
OnGotFocus(RoutedEventArgs) Microsoft.UI.Xaml.Controls.ItemsControl.OnGotFocus(Microsoft.UI.Xaml.RoutedEventArgs)
OnTapped(TappedRoutedEventArgs) Microsoft.UI.Xaml.Controls.ItemsControl.OnTapped(Microsoft.UI.Xaml.Input.TappedRoutedEventArgs)
ShowMenu()

This method is used to show the menu for current item

Applies to