Skip to main content

NativeMenu Class

Definition​

Assembly:Avalonia.Controls
Package:Avalonia
public class NativeMenu

Inheritance: object -> AvaloniaObject -> NativeMenu

Implements: IAvaloniaListItemValidator<NativeMenuItemBase>, INativeMenuExporterEventsImplBridge, IEnumerable<NativeMenuItemBase>, IEnumerable

Constructors​

NameDescription
NativeMenuNo summary available.

NativeMenu Constructor​

public NativeMenu()

Methods​

NameDescription
AddNo summary available.
Bind (8 overloads)Binds a Avalonia.AvaloniaProperty to an Avalonia.Data.BindingBase. Inherited from AvaloniaObject.
CheckAccessReturns a value indicating whether the current thread is the UI thread. Inherited from AvaloniaObject.
ClearValue (4 overloads)Clears a Avalonia.AvaloniaProperty's local value. Inherited from AvaloniaObject.
CoerceValueCoerces the specified Avalonia.AvaloniaProperty. Inherited from AvaloniaObject.
EqualsCompares two objects using reference equality. Inherited from AvaloniaObject.
GetBaseValueInherited from AvaloniaObject.
GetEnumeratorNo summary available.
GetHashCodeGets the hash code for the object. Inherited from AvaloniaObject.
GetIsNativeMenuExportedNo summary available.
GetMenuNo summary available.
GetValue (3 overloads)Gets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject.
IsAnimatingChecks whether a Avalonia.AvaloniaProperty is animating. Inherited from AvaloniaObject.
IsSetChecks whether a Avalonia.AvaloniaProperty is set on this object. Inherited from AvaloniaObject.
SetCurrentValue (2 overloads)Sets the value of a dependency property without changing its value source. Inherited from AvaloniaObject.
SetMenuNo summary available.
SetValue (3 overloads)Sets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject.
VerifyAccessChecks that the current thread is the UI thread and throws if not. Inherited from AvaloniaObject.

Add Method​

public void Add(Avalonia.Controls.NativeMenuItemBase item)

Parameters​

item Avalonia.Controls.NativeMenuItemBase

GetEnumerator Method​

public System.Collections.Generic.IEnumerator<Avalonia.Controls.NativeMenuItemBase> GetEnumerator()

Returns​

System.Collections.Generic.IEnumerator<Avalonia.Controls.NativeMenuItemBase>

GetIsNativeMenuExported Method​

public bool GetIsNativeMenuExported(Avalonia.Controls.TopLevel tl)

Parameters​

tl Avalonia.Controls.TopLevel

Returns​

bool

GetMenu Method​

public Avalonia.Controls.NativeMenu GetMenu(Avalonia.AvaloniaObject o)

Parameters​

o Avalonia.AvaloniaObject

Returns​

Avalonia.Controls.NativeMenu

SetMenu Method​

public void SetMenu(Avalonia.AvaloniaObject o, Avalonia.Controls.NativeMenu menu)

Parameters​

o Avalonia.AvaloniaObject

menu Avalonia.Controls.NativeMenu

Properties​

NameDescription
DispatcherReturns the Avalonia.AvaloniaObject.Dispatcher that this Avalonia.AvaloniaObject is associated with. Inherited from AvaloniaObject.
ItemInherited from AvaloniaObject.
ItemsNo summary available.
ParentNo summary available.

Items Property​

public System.Collections.Generic.IList<Avalonia.Controls.NativeMenuItemBase> Items { get; set; }

Parent Property​

public Avalonia.Controls.NativeMenuItem Parent { get; set; }

Fields​

NameDescription
IsNativeMenuExportedPropertyNo summary available.
MenuPropertyNo summary available.
ParentPropertyNo summary available.

IsNativeMenuExportedProperty Field​

public Avalonia.AttachedProperty<bool> IsNativeMenuExportedProperty
public Avalonia.AttachedProperty<Avalonia.Controls.NativeMenu> MenuProperty

ParentProperty Field​

public Avalonia.DirectProperty<Avalonia.Controls.NativeMenu, Avalonia.Controls.NativeMenuItem> ParentProperty

Events​

NameDescription
ClosedRaised after the menu is closed.
NeedsUpdateRaised when the menu requests an update.
OpeningRaised before the menu is opened.
PropertyChangedRaised when a Avalonia.AvaloniaProperty value changes on this object. Inherited from AvaloniaObject.

Closed Event​

Raised after the menu is closed.

public event EventHandler<EventArgs> Closed

Remarks​

Do not update the menu in this event; use Avalonia.Controls.NativeMenu.NeedsUpdate.

NeedsUpdate Event​

Raised when the menu requests an update.

public event EventHandler<EventArgs> NeedsUpdate

Remarks​

Use this event to add, remove or modify menu items before a menu is shown or a hotkey is pressed.

Opening Event​

Raised before the menu is opened.

public event EventHandler<EventArgs> Opening

Remarks​

Do not update the menu in this event; use Avalonia.Controls.NativeMenu.NeedsUpdate.