Skip to content

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

NameSummary
.ctorInitializes a new instance of the [NavigationViewItem](# class.

Properties

NameSummary
IdGets unique identifier that allows the item to be located in the navigation.
MenuItemsGets the collection of menu items displayed in the NavigationView.
MenuItemsSourceGets or sets an object source used to generate the content of the NavigationView menu.
HasMenuItemsGets a value indicating whether this instance has menu items.
IsActiveGets a value indicating whether gets information whether the current element is active.
IsPaneOpenGets or sets a value indicating whether the parent pane is open.
IsExpandedGets or sets a value indicating whether gets information whether the sub-[MenuItems](# are expanded.
IconGets or sets the icon displayed in the MenuItem object.
TargetPageTagGets or sets a unique tag used by the parent navigation system for the purpose of searching and navigating.
TargetPageTypeGets or sets the type of the page to be navigated. (Should be derived from Control).
TargetViewModelTypeGets or sets the target ViewModel type for ViewModel-first navigation. When set this takes precedence over TargetPageType.
TargetHostNameGets or sets an optional host name (navigation host) to target when using ViewModel-first navigation. Leave empty to use the first registered host.
InfoBadgeGets or sets the information badge.
NavigationCacheModeGets or sets specifies caching characteristics for a page involved in a navigation.
TemplateGets or sets template Property.
NavigationViewItemParentGets or sets parent if in [MenuItems](# collection.
IsMenuElementGets or sets a value indicating whether this instance is menu element.

Fields

NameSummary
static MenuItemsPropertyProperty for [MenuItems](#
static MenuItemsSourcePropertyProperty for [MenuItemsSource](#
static HasMenuItemsPropertyProperty for [HasMenuItems](#
static IsActivePropertyProperty for [IsActive](#
static IsPaneOpenPropertyProperty for [IsPaneOpen](#
static IsExpandedPropertyProperty for [IsExpanded](#
static IconPropertyProperty for [Icon](#
static TargetPageTagPropertyProperty for [TargetPageTag](#
static TargetPageTypePropertyProperty for [TargetPageType](#
static TargetViewModelTypePropertyProperty for [TargetViewModelType](#
static TargetHostNamePropertyProperty for [TargetHostName](#
static InfoBadgePropertyProperty for [InfoBadge](#
static NavigationCacheModePropertyProperty for [NavigationCacheMode](#
static TemplateElementChevronGridThe template element chevron grid.

Methods

NameSummary
ActivateCorrectly activates.
DeactivateCorrectly deactivates.
OnApplyTemplateCalled when the control's template is applied. In simple terms, this means the method is called just before the control is displayed.
OnClickInvokes the Click event.

Events

NameSummary
ClickAdd / Remove ClickEvent handler.
Inherited members