Skip to main content

NavigationView

Description​

NavigationView is a WPF Selector that presents application destinations in a left or top pane.

NavigationView in light mode NavigationView in dark mode

Compact pane​

NavigationView with its navigation pane collapsed to compact mode in light mode NavigationView with its navigation pane collapsed to compact mode in dark mode

Example usage​

<fluence:NavigationView PaneDisplayMode="Left">
<fluence:NavigationViewItem Content="Home" IsSelected="True" />
<fluence:NavigationViewItem Content="Files" />
</fluence:NavigationView>

Key properties​

PropertyDefaultPurpose
PaneDisplayModeLeftChooses the navigation layout.
IsPaneOpentrueControls whether the pane is open.
ContentnullHosts the current page or view.
FooterMenuItemsEmpty collectionContains destinations pinned to the pane footer.
IsBackButtonVisiblefalseShows the navigation back button.

State and behavior​

Top-mode overflow​

In Top mode, items that do not fit move into the overflow menu. The control keeps first-fit item order and remeasures an overflowed item when its Content is replaced or when the Text property changes on a hidden WPF TextBlock content object. TextBlock content uses its text as the menu label. For other visual content, set AutomationProperties.Name when you need a specific readable label. Data items keep their source item template in the menu; changes inside arbitrary templates or TextBlock.Inlines are not tracked automatically.

Selection moves the indicator; pane display mode changes the shell layout and back requests are explicit.

Assign the page host explicitly to NavigationView.Content: an unnamed child is added to the item collection instead of becoming the page host. The application controls page history.

Events​

ItemInvoked reports a destination invocation. BackRequested reports a back-button request; the application owns navigation history.

Parts​

NavigationViewItem is a selectable destination inside NavigationView. The screenshots show NavigationViewItem inside NavigationView.

Use it for a selectable destination in NavigationView.

The parent control capture above shows this part in context.

<fluence:NavigationView>
<fluence:NavigationViewItem Content="Home" IsSelected="True" />
<fluence:NavigationViewItem Content="Files" />
</fluence:NavigationView>

Selected and unselected destinations differ visually; InfoBadge can show item status.

Use a header to label a group of destinations in NavigationView. The screenshots show NavigationViewItemHeader inside NavigationView.

The parent control capture above shows this part in context.

<fluence:NavigationView>
<fluence:NavigationViewItemHeader Content="Workspace" />
<fluence:NavigationViewItem Content="Home" />
</fluence:NavigationView>

Headers label groups of NavigationView items; they do not navigate as destinations.

Use a separator to divide destination groups in NavigationView. The screenshots show NavigationViewItemSeparator inside NavigationView.

The parent control capture above shows this part in context.

<fluence:NavigationView>
<fluence:NavigationViewItem Content="Home" />
<fluence:NavigationViewItemSeparator />
<fluence:NavigationViewItem Content="Settings" />
</fluence:NavigationView>

Separators divide destination groups and have no selected state.

Additional behavior​

NavigationView derives from Selector. Put its page host in NavigationView.Content, because an unnamed child enters the item collection. The application controls its navigation history. TabView extends WPF TabControl; a close request does not remove the item for you. See navigation and tabs.

Reordering NavigationView.FooterMenuItems preserves a selected item that remains present. Removing or clearing that selected footer item clears its footer selection; it does not select an unrelated main item.

Reference​