Class NativeMenu
public class NativeMenu : AvaloniaObject, INotifyPropertyChanged, IEnumerable<NativeMenuItemBase>, IEnumerable, INativeMenuExporterEventsImplBridge
- Inheritance
-
NativeMenu
- Implements
- Inherited Members
Constructors
NativeMenu()
public NativeMenu()
Fields
IsNativeMenuExportedProperty
public static readonly AttachedProperty<bool> IsNativeMenuExportedProperty
Field Value
MenuProperty
public static readonly AttachedProperty<NativeMenu?> MenuProperty
Field Value
ParentProperty
public static readonly DirectProperty<NativeMenu, NativeMenuItem?> ParentProperty
Field Value
Properties
Items
[Content]
public IList<NativeMenuItemBase> Items { get; }
Property Value
Parent
public NativeMenuItem? Parent { get; }
Property Value
Methods
Add(NativeMenuItemBase)
public void Add(NativeMenuItemBase item)
Parameters
item
NativeMenuItemBase
GetEnumerator()
public IEnumerator<NativeMenuItemBase> GetEnumerator()
Returns
GetIsNativeMenuExported(TopLevel)
public static bool GetIsNativeMenuExported(TopLevel tl)
Parameters
tl
TopLevel
Returns
GetMenu(AvaloniaObject)
public static NativeMenu? GetMenu(AvaloniaObject o)
Parameters
Returns
SetMenu(AvaloniaObject, NativeMenu?)
public static void SetMenu(AvaloniaObject o, NativeMenu? menu)
Parameters
o
AvaloniaObjectmenu
NativeMenu
Events
Closed
Raised after the menu is closed.
public event EventHandler<EventArgs>? Closed
Event Type
Remarks
Do not update the menu in this event; use NeedsUpdate.
NeedsUpdate
Raised when the menu requests an update.
public event EventHandler<EventArgs>? NeedsUpdate
Event Type
Remarks
Use this event to add, remove or modify menu items before a menu is shown or a hotkey is pressed.
Opening
Raised before the menu is opened.
public event EventHandler<EventArgs>? Opening
Event Type
Remarks
Do not update the menu in this event; use NeedsUpdate.