NavigationViewItem class¶
Defined in
Namespace: CrissCross.Avalonia.UI.Controls
Assembly: CrissCross.Avalonia.UI.dll
Full name: CrissCross.Avalonia.UI.Controls.NavigationViewItem
Modifiers: public
Summary¶
Represents the container for an item in a NavigationView control.
When needed, it can be used as a normal button with a Click action.
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net471
Class hierarchy
classDiagram
class NavigationViewItem
class Button
Button <|-- NavigationViewItem
class INavigationViewItem {
<>
}
INavigationViewItem <|.. NavigationViewItem
Inherits from: Button
Implements: INavigationViewItem
Constructors¶
| Name | Summary |
|---|---|
| .ctor | Initializes a new instance of the [NavigationViewItem](# class. |
Properties¶
| Name | Summary |
|---|---|
| Id | Gets unique identifier that allows the item to be located in the navigation. |
| MenuItems | Gets the collection of menu items displayed in the NavigationView. |
| MenuItemsSource | Gets or sets an object source used to generate the content of the NavigationView menu. |
| HasMenuItems | Gets a value indicating whether this instance has menu items. |
| IsActive | Gets a value indicating whether gets information whether the current element is active. |
| IsPaneOpen | Gets or sets a value indicating whether the parent pane is open. |
| IsExpanded | Gets or sets a value indicating whether gets information whether the sub-[MenuItems](# are expanded. |
| Icon | Gets or sets the icon displayed in the MenuItem object. |
| TargetPageTag | Gets or sets a unique tag used by the parent navigation system for the purpose of searching and navigating. |
| TargetPageType | Gets or sets the type of the page to be navigated. (Should be derived from Control). |
| TargetViewModelType | Gets or sets the target ViewModel type for ViewModel-first navigation. When set this takes precedence over TargetPageType. |
| TargetHostName | Gets or sets an optional host name (navigation host) to target when using ViewModel-first navigation. Leave empty to use the first registered host. |
| InfoBadge | Gets or sets the information badge. |
| NavigationCacheMode | Gets or sets specifies caching characteristics for a page involved in a navigation. |
| Template | Gets or sets template Property. |
| NavigationViewItemParent | Gets or sets parent if in [MenuItems](# collection. |
| IsMenuElement | Gets or sets a value indicating whether this instance is menu element. |
Fields¶
| Name | Summary |
|---|---|
| static MenuItemsProperty | Property for [MenuItems](# |
| static MenuItemsSourceProperty | Property for [MenuItemsSource](# |
| static HasMenuItemsProperty | Property for [HasMenuItems](# |
| static IsActiveProperty | Property for [IsActive](# |
| static IsPaneOpenProperty | Property for [IsPaneOpen](# |
| static IsExpandedProperty | Property for [IsExpanded](# |
| static IconProperty | Property for [Icon](# |
| static TargetPageTagProperty | Property for [TargetPageTag](# |
| static TargetPageTypeProperty | Property for [TargetPageType](# |
| static TargetViewModelTypeProperty | Property for [TargetViewModelType](# |
| static TargetHostNameProperty | Property for [TargetHostName](# |
| static InfoBadgeProperty | Property for [InfoBadge](# |
| static NavigationCacheModeProperty | Property for [NavigationCacheMode](# |
| static TemplateElementChevronGrid | The template element chevron grid. |
Methods¶
| Name | Summary |
|---|---|
| Activate | Correctly activates. |
| Deactivate | Correctly deactivates. |
| OnApplyTemplate | Called when the control's template is applied. In simple terms, this means the method is called just before the control is displayed. |
| OnClick | Invokes the Click event. |
Events¶
| Name | Summary |
|---|---|
| Click | Add / Remove ClickEvent handler. |