Class NavigationViewItem
Represents the container for an item in a NavigationView control. When needed, it can be used as a normal button with a Click action.
[TemplatePart(Name = "PART_ChevronGrid", Type = typeof(Grid))]
public class NavigationViewItem : ButtonBase, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild, ICommandSource, INavigationViewItem, IIconControl
- Inheritance
-
NavigationViewItem
- Implements
- Inherited Members
Constructors
NavigationViewItem()
public NavigationViewItem()
NavigationViewItem(string, Type)
public NavigationViewItem(string name, Type targetPageType)
Parameters
NavigationViewItem(string, SymbolRegular, Type)
public NavigationViewItem(string name, SymbolRegular icon, Type targetPageType)
Parameters
name
stringicon
SymbolRegulartargetPageType
Type
NavigationViewItem(string, SymbolRegular, Type, IList)
public NavigationViewItem(string name, SymbolRegular icon, Type targetPageType, IList menuItems)
Parameters
name
stringicon
SymbolRegulartargetPageType
TypemenuItems
IList
NavigationViewItem(Type)
public NavigationViewItem(Type targetPageType)
Parameters
targetPageType
Type
Fields
HasMenuItemsProperty
Identifies the HasMenuItems dependency property.
public static readonly DependencyProperty HasMenuItemsProperty
Field Value
IconProperty
Identifies the Icon dependency property.
public static readonly DependencyProperty IconProperty
Field Value
InfoBadgeProperty
Identifies the InfoBadge dependency property.
public static readonly DependencyProperty InfoBadgeProperty
Field Value
IsActiveProperty
Identifies the IsActive dependency property.
public static readonly DependencyProperty IsActiveProperty
Field Value
IsExpandedProperty
Identifies the IsExpanded dependency property.
public static readonly DependencyProperty IsExpandedProperty
Field Value
IsPaneOpenProperty
Identifies the IsPaneOpen dependency property.
public static readonly DependencyProperty IsPaneOpenProperty
Field Value
MenuItemsProperty
Identifies the MenuItems dependency property.
public static readonly DependencyProperty MenuItemsProperty
Field Value
MenuItemsSourceProperty
Identifies the MenuItemsSource dependency property.
public static readonly DependencyProperty MenuItemsSourceProperty
Field Value
NavigationCacheModeProperty
Identifies the NavigationCacheMode dependency property.
public static readonly DependencyProperty NavigationCacheModeProperty
Field Value
TargetPageTagProperty
Identifies the TargetPageTag dependency property.
public static readonly DependencyProperty TargetPageTagProperty
Field Value
TargetPageTypeProperty
Identifies the TargetPageType dependency property.
public static readonly DependencyProperty TargetPageTypeProperty
Field Value
TemplateElementChevronGrid
protected const string TemplateElementChevronGrid = "PART_ChevronGrid"
Field Value
Properties
ChevronGrid
protected Grid? ChevronGrid { get; set; }
Property Value
HasMenuItems
Gets a value indicating whether MenuItems.Count > 0
[Browsable(false)]
public bool HasMenuItems { get; }
Property Value
Icon
Gets or sets the icon displayed in the MenuItem object.
[Bindable(true)]
public IconElement? Icon { get; set; }
Property Value
Id
Gets the unique identifier that allows the item to be located in the navigation.
public string Id { get; }
Property Value
InfoBadge
public InfoBadge? InfoBadge { get; set; }
Property Value
IsActive
Gets a value indicating whether the current element is active.
[Browsable(false)]
public bool IsActive { get; set; }
Property Value
IsExpanded
Gets or sets a value indicating whether the sub-MenuItems are expanded.
[Browsable(false)]
public bool IsExpanded { get; set; }
Property Value
IsMenuElement
public bool IsMenuElement { get; set; }
Property Value
IsPaneOpen
[Browsable(false)]
public bool IsPaneOpen { get; set; }
Property Value
MenuItems
Gets the collection of menu items displayed in the NavigationView.
public IList MenuItems { get; }
Property Value
MenuItemsSource
Gets or sets an object source used to generate the content of the NavigationView menu.
[Bindable(true)]
public object? MenuItemsSource { get; set; }
Property Value
NavigationCacheMode
Gets or sets the caching characteristics for a page involved in a navigation.
public NavigationCacheMode NavigationCacheMode { get; set; }
Property Value
NavigationViewItemParent
Gets or sets the parent if it's in MenuItems collection
public INavigationViewItem? NavigationViewItemParent { get; set; }
Property Value
TargetPageTag
Gets or sets the unique tag used by the parent navigation system for the purpose of searching and navigating.
public string TargetPageTag { get; set; }
Property Value
TargetPageType
Gets or sets the type of the page to be navigated. (Should be derived from FrameworkElement).
public Type? TargetPageType { get; set; }
Property Value
Methods
Activate(INavigationView)
Correctly activates
public virtual void Activate(INavigationView navigationView)
Parameters
navigationView
INavigationView
Deactivate(INavigationView)
Correctly deactivates
public virtual void Deactivate(INavigationView navigationView)
Parameters
navigationView
INavigationView
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
OnClick()
Raises the Click routed event.
protected override void OnClick()
OnInitialized(EventArgs)
Raises the Initialized event. This method is invoked whenever IsInitialized is set to true
internally.
protected override void OnInitialized(EventArgs e)
Parameters
e
EventArgsThe RoutedEventArgs that contains the event data.
OnMouseDown(MouseButtonEventArgs)
Is called when mouse is clicked down.
protected override void OnMouseDown(MouseButtonEventArgs e)