Table of Contents

Class NativeMenuBar

Namespace
Avalonia.Controls
Assembly
Avalonia.Controls.dll
[TemplatePart("PART_NativeMenuPresenter", typeof(MenuBase))]
public class NativeMenuBar : TemplatedControl, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue
Inheritance
NativeMenuBar
Implements
Inherited Members
Extension Methods

Constructors

NativeMenuBar()

public NativeMenuBar()

Fields

EnableMenuItemClickForwardingProperty

[Unstable("To be removed in 12.0, NativeMenuBar now has a default template")]
public static readonly AttachedProperty<bool> EnableMenuItemClickForwardingProperty

Field Value

AttachedProperty<bool>

Methods

OnApplyTemplate(TemplateAppliedEventArgs)

Called when the control's template is applied. In simple terms, this means the method is called just before the control is displayed.

protected override void OnApplyTemplate(TemplateAppliedEventArgs e)

Parameters

e TemplateAppliedEventArgs

The event args.

OnAttachedToVisualTree(VisualTreeAttachmentEventArgs)

Called when the control is added to a rooted visual tree.

protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)

Parameters

e VisualTreeAttachmentEventArgs

The event args.

OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs)

Called when the control is removed from a rooted visual tree.

protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)

Parameters

e VisualTreeAttachmentEventArgs

The event args.

SetEnableMenuItemClickForwarding(MenuItem, bool)

[Unstable("To be removed in 12.0, NativeMenuBar now has a default template.")]
public static void SetEnableMenuItemClickForwarding(MenuItem menuItem, bool enable)

Parameters

menuItem MenuItem
enable bool