NativeMenuItem Class
Definition
public class NativeMenuItem
Constructors
| Name | Description |
|---|---|
| NativeMenuItem (2 overloads) | No summary available. |
NativeMenuItem overloads
NativeMenuItem Constructor
public NativeMenuItem()
NativeMenuItem Constructor
public NativeMenuItem(string header)
Parameters
header string
Methods
| Name | Description |
|---|---|
| Bind (8 overloads) | Binds a Avalonia.AvaloniaProperty to an Avalonia.Data.BindingBase. Inherited from AvaloniaObject. |
| CheckAccess | Returns 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. |
| CoerceValue | Coerces the specified Avalonia.AvaloniaProperty. Inherited from AvaloniaObject. |
| Equals | Compares two objects using reference equality. Inherited from AvaloniaObject. |
| GetBaseValue | Inherited from AvaloniaObject. |
| GetHashCode | Gets the hash code for the object. Inherited from AvaloniaObject. |
| GetValue (3 overloads) | Gets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject. |
| IsAnimating | Checks whether a Avalonia.AvaloniaProperty is animating. Inherited from AvaloniaObject. |
| IsSet | Checks 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. |
| SetValue (3 overloads) | Sets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject. |
| VerifyAccess | Checks that the current thread is the UI thread and throws if not. Inherited from AvaloniaObject. |
Properties
| Name | Description |
|---|---|
| Command | Gets or sets the command associated with the menu item. |
| CommandParameter | Gets or sets the parameter to pass to the Avalonia.Controls.MenuItem.Command property of a Avalonia.Controls.MenuItem. |
| Gesture | Gets or sets the input gesture that will be displayed in the menu item. |
| HasClickHandlers | No summary available. |
| Header | Gets or sets the content of the control's header. |
| Icon | Gets or sets the icon that appears in a Avalonia.Controls.MenuItem. |
| IsChecked | Gets or sets if menu item is checked when Avalonia.Controls.MenuItem.ToggleType is Avalonia.Controls.MenuItemToggleType.CheckBox or Avalonia.Controls.MenuItemToggleType.Radio. |
| IsEnabled | Gets or sets a value indicating whether the control is enabled for user interaction. |
| IsVisible | Gets or sets a value indicating whether this menu item is visible. |
| Menu | No summary available. |
| ToggleType | Gets toggle type of the menu item. |
| ToolTip | Gets or sets the tooltip associated with the menu item. This may not be supported by the native menu provider, but will be passed on to the non-native fallback menu item if used. |
| Parent | Inherited from NativeMenuItemBase. |
| Dispatcher | Returns the Avalonia.AvaloniaObject.Dispatcher that this Avalonia.AvaloniaObject is associated with. Inherited from AvaloniaObject. |
| Item | Inherited from AvaloniaObject. |
Command Property
Gets or sets the command associated with the menu item.
public System.Windows.Input.ICommand Command { get; set; }
CommandParameter Property
Gets or sets the parameter to pass to the Avalonia.Controls.MenuItem.Command property of a Avalonia.Controls.MenuItem.
public object CommandParameter { get; set; }
Gesture Property
Gets or sets the input gesture that will be displayed in the menu item.
public Avalonia.Input.KeyGesture Gesture { get; set; }
Remarks
Setting this property does not cause the input gesture to be handled by the menu item, it simply displays the gesture text in the menu.
HasClickHandlers Property
public bool HasClickHandlers { get; set; }
Header Property
Gets or sets the content of the control's header.
public string Header { get; set; }
Icon Property
Gets or sets the icon that appears in a Avalonia.Controls.MenuItem.
public Avalonia.Media.Imaging.Bitmap Icon { get; set; }
IsChecked Property
Gets or sets if menu item is checked when Avalonia.Controls.MenuItem.ToggleType is Avalonia.Controls.MenuItemToggleType.CheckBox or Avalonia.Controls.MenuItemToggleType.Radio.
public bool IsChecked { get; set; }
IsEnabled Property
Gets or sets a value indicating whether the control is enabled for user interaction.
public bool IsEnabled { get; set; }
IsVisible Property
Gets or sets a value indicating whether this menu item is visible.
public bool IsVisible { get; set; }
Menu Property
public Avalonia.Controls.NativeMenu Menu { get; set; }
ToggleType Property
Gets toggle type of the menu item.
public Avalonia.Controls.MenuItemToggleType ToggleType { get; set; }
ToolTip Property
Gets or sets the tooltip associated with the menu item. This may not be supported by the native menu provider, but will be passed on to the non-native fallback menu item if used.
public string ToolTip { get; set; }
Fields
| Name | Description |
|---|---|
| CommandParameterProperty | Defines the Avalonia.Controls.MenuItem.CommandParameter property. |
| CommandProperty | Defines the Avalonia.Controls.MenuItem.Command property. |
| GestureProperty | Defines the Avalonia.Controls.MenuItem.InputGesture property. |
| HeaderProperty | Defines the Avalonia.Controls.Primitives.HeaderedSelectingItemsControl.Header property. |
| IconProperty | Defines the Avalonia.Controls.MenuItem.Icon property. |
| IsCheckedProperty | Defines the Avalonia.Controls.MenuItem.IsChecked property. |
| IsEnabledProperty | Defines the Avalonia.Input.InputElement.IsEnabled property. |
| IsVisibleProperty | Defines the Avalonia.Controls.NativeMenuItem.IsVisible property. |
| MenuProperty | No summary available. |
| ToggleTypeProperty | Defines the Avalonia.Controls.MenuItem.ToggleType property. |
| ToolTipProperty | Defines the Avalonia.Controls.NativeMenuItem.ToolTip property. |
| ParentProperty | Inherited from NativeMenuItemBase. |
CommandParameterProperty Field
Defines the Avalonia.Controls.MenuItem.CommandParameter property.
public Avalonia.StyledProperty<object> CommandParameterProperty
CommandProperty Field
Defines the Avalonia.Controls.MenuItem.Command property.
public Avalonia.StyledProperty<System.Windows.Input.ICommand> CommandProperty
GestureProperty Field
Defines the Avalonia.Controls.MenuItem.InputGesture property.
public Avalonia.StyledProperty<Avalonia.Input.KeyGesture> GestureProperty
HeaderProperty Field
Defines the Avalonia.Controls.Primitives.HeaderedSelectingItemsControl.Header property.
public Avalonia.StyledProperty<string> HeaderProperty
IconProperty Field
Defines the Avalonia.Controls.MenuItem.Icon property.
public Avalonia.StyledProperty<Avalonia.Media.Imaging.Bitmap> IconProperty
IsCheckedProperty Field
Defines the Avalonia.Controls.MenuItem.IsChecked property.
public Avalonia.StyledProperty<bool> IsCheckedProperty
IsEnabledProperty Field
Defines the Avalonia.Input.InputElement.IsEnabled property.
public Avalonia.StyledProperty<bool> IsEnabledProperty
IsVisibleProperty Field
Defines the Avalonia.Controls.NativeMenuItem.IsVisible property.
public Avalonia.StyledProperty<bool> IsVisibleProperty
MenuProperty Field
public Avalonia.StyledProperty<Avalonia.Controls.NativeMenu> MenuProperty
ToggleTypeProperty Field
Defines the Avalonia.Controls.MenuItem.ToggleType property.
public Avalonia.StyledProperty<Avalonia.Controls.MenuItemToggleType> ToggleTypeProperty
ToolTipProperty Field
Defines the Avalonia.Controls.NativeMenuItem.ToolTip property.
public Avalonia.StyledProperty<string> ToolTipProperty
Events
| Name | Description |
|---|---|
| Click | Occurs when a Avalonia.Controls.NativeMenuItem is clicked. |
| PropertyChanged | Raised when a Avalonia.AvaloniaProperty value changes on this object. Inherited from AvaloniaObject. |
Click Event
Occurs when a Avalonia.Controls.NativeMenuItem is clicked.
public event EventHandler Click