Class MenuBase
Represents a control that defines choices for users to select.
Inheritance
System.Object
MenuBase
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Controls.Primitives
Assembly: OpenSilver.dll
Syntax
[StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(MenuItem))]
public abstract class MenuBase : ItemsControl, IControl, IFrameworkElement, IUIElement, IDependencyObject
Constructors
| Improve this Doc View SourceMenuBase()
Initializes a new instance of the MenuBase class.
Declaration
public MenuBase()
Fields
| Improve this Doc View SourceItemContainerStyleProperty
Identifies the ItemContainerStyle dependency property.
Declaration
public static readonly DependencyProperty ItemContainerStyleProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceItemContainerStyle
Gets or sets the Style that is applied to the container element generated for each item.
Declaration
public Style ItemContainerStyle { get; set; }
Property Value
Type | Description |
---|---|
Style |
Methods
| Improve this Doc View SourceGetContainerForItemOverride()
Creates or identifies the element used to display the specified item.
Declaration
protected override DependencyObject GetContainerForItemOverride()
Returns
Type | Description |
---|---|
DependencyObject | A MenuItem. |
Overrides
| Improve this Doc View SourceIsItemItsOwnContainerOverride(Object)
Determines whether the specified item is, or is eligible to be, its own item container.
Declaration
protected override bool IsItemItsOwnContainerOverride(object item)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item | The item to check whether it is an item container. |
Returns
Type | Description |
---|---|
System.Boolean | True if the item is a MenuItem or a Separator; otherwise, false. |
Overrides
| Improve this Doc View SourcePrepareContainerForItemOverride(DependencyObject, Object)
Prepares the specified element to display the specified item.
Declaration
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | element | Element used to display the specified item. |
System.Object | item | Specified item. |