In This Article

MenuFactoryCreateMenuItemOptions Class

The options to be used when creating a menu item using IMenuFactory.

public class MenuFactoryCreateMenuItemOptions
Inheritance:
object object

Constructors

MenuFactoryCreateMenuItemOptions()

Initializes an instance of the class.

public MenuFactoryCreateMenuItemOptions()

Properties

AllowAccessKey

Indicates if Text allows access key.

public bool AllowAccessKey { get; set; }

Property Value

bool:

true to allow access keys; otherwise, false to escape the underscores characters that identify access keys. The default value is true.

Command

The ICommand to assign to the menu item.

public ICommand? Command { get; set; }

Property Value

ICommand

CommandParameter

The command parameter.

public object? CommandParameter { get; set; }

Property Value

object

Icon

The object which defines the menu icon.

public object? Icon { get; set; }

Property Value

object

IconTemplate

The Avalonia.Controls.Templates.IDataTemplate that may be necessary to display the Icon.

public IDataTemplate? IconTemplate { get; set; }

Property Value

IDataTemplate

InputGesture

The input gesture associated with the menu item.

public KeyGesture? InputGesture { get; set; }

Property Value

KeyGesture

IsChecked

Whether the menu item is checked.

public bool? IsChecked { get; set; }

Property Value

bool?:

Since menu items do not support tri-state, a null value indicates the menu item cannot be checked.

Name

The name that uniquely identifies the menu item and may also be used for automation ID.

public string? Name { get; set; }

Property Value

string

Owner

An owner for the menu item which can be used for additional context.

public object? Owner { get; set; }

Property Value

object

Text

The text to be displayed.

public string? Text { get; set; }

Property Value

string

ToggleType

The toggle type to be used for checkable menu items.

public MenuItemToggleType ToggleType { get; set; }

Property Value

MenuItemToggleType:

This property is ignored when IsChecked is null. The default value is Avalonia.Controls.MenuItemToggleType.CheckBox.

Inherited Members

Extension Methods