Class NativeMenuItem
public class NativeMenuItem : NativeMenuItemBase, INotifyPropertyChanged, INativeMenuItemExporterEventsImplBridge
- Inheritance
-
NativeMenuItem
- Implements
- Derived
- Inherited Members
Constructors
NativeMenuItem()
public NativeMenuItem()
NativeMenuItem(string)
public NativeMenuItem(string header)
Parameters
header
string
Fields
CommandParameterProperty
Defines the CommandParameter property.
public static readonly StyledProperty<object?> CommandParameterProperty
Field Value
CommandProperty
Defines the Command property.
public static readonly StyledProperty<ICommand?> CommandProperty
Field Value
GestureProperty
Defines the InputGesture property.
public static readonly StyledProperty<KeyGesture?> GestureProperty
Field Value
HeaderProperty
Defines the Header property.
public static readonly StyledProperty<string?> HeaderProperty
Field Value
IconProperty
Defines the Icon property.
public static readonly StyledProperty<Bitmap?> IconProperty
Field Value
IsCheckedProperty
Defines the IsChecked property.
public static readonly StyledProperty<bool> IsCheckedProperty
Field Value
IsEnabledProperty
Defines the IsEnabled property.
public static readonly StyledProperty<bool> IsEnabledProperty
Field Value
IsVisibleProperty
Defines the IsVisible property.
public static readonly StyledProperty<bool> IsVisibleProperty
Field Value
MenuProperty
public static readonly StyledProperty<NativeMenu?> MenuProperty
Field Value
ToggleTypeProperty
Defines the ToggleType property.
public static readonly StyledProperty<NativeMenuItemToggleType> ToggleTypeProperty
Field Value
ToolTipProperty
Defines the ToolTip property.
public static readonly StyledProperty<string?> ToolTipProperty
Field Value
Properties
Command
Gets or sets the command associated with the menu item.
public ICommand? Command { get; set; }
Property Value
CommandParameter
public object? CommandParameter { get; set; }
Property Value
Gesture
Gets or sets the input gesture that will be displayed in the menu item.
public KeyGesture? Gesture { get; set; }
Property Value
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
public bool HasClickHandlers { get; }
Property Value
Header
Gets or sets the content of the control's header.
public string? Header { get; set; }
Property Value
Icon
Gets or sets the icon that appears in a MenuItem.
public Bitmap? Icon { get; set; }
Property Value
IsChecked
Gets or sets if menu item is checked when ToggleType is CheckBox or Radio.
public bool IsChecked { get; set; }
Property Value
IsEnabled
Gets or sets a value indicating whether the control is enabled for user interaction.
public bool IsEnabled { get; set; }
Property Value
IsVisible
Gets or sets a value indicating whether this menu item is visible.
public bool IsVisible { get; set; }
Property Value
Menu
[Content]
public NativeMenu? Menu { get; set; }
Property Value
ToggleType
Gets toggle type of the menu item.
public NativeMenuItemToggleType ToggleType { get; set; }
Property Value
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.
public string? ToolTip { get; set; }
Property Value
Methods
OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
Called when a avalonia property changes on the object.
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
Parameters
change
AvaloniaPropertyChangedEventArgsThe property change details.
Events
Click
Occurs when a NativeMenuItem is clicked.
public event EventHandler? Click