Table of Contents

Interface INavigationView

Namespace
Wpf.Ui.Controls
Assembly
Wpf.Ui.dll

Represents a container that enables navigation of app content. It has a header, a view for the main content, and a menu pane for navigation commands.

public interface INavigationView

Properties

AlwaysShowHeader

Gets or sets a value indicating whether the header is always visible.

bool AlwaysShowHeader { get; set; }

Property Value

bool

AutoSuggestBox

Gets or sets an AutoSuggestBox to be displayed in the NavigationView.

AutoSuggestBox? AutoSuggestBox { get; set; }

Property Value

AutoSuggestBox

BreadcrumbBar

Gets or sets an BreadcrumbBar that is in Header.

BreadcrumbBar? BreadcrumbBar { get; set; }

Property Value

BreadcrumbBar

CanGoBack

Gets a value indicating whether there is at least one entry in back navigation history.

bool CanGoBack { get; }

Property Value

bool

CompactPaneLength

Gets or sets the width of the NavigationView pane in its compact display mode.

double CompactPaneLength { get; set; }

Property Value

double

ContentOverlay

Gets or sets a UI element that is shown at the top of the control, below the pane if PaneDisplayMode is Top.

object? ContentOverlay { get; set; }

Property Value

object

FooterMenuItems

Gets the list of objects to be used as navigation items in the footer menu.

IList FooterMenuItems { get; }

Property Value

IList

FooterMenuItemsSource

Gets or sets the object that represents the navigation items to be used in the footer menu.

object? FooterMenuItemsSource { get; set; }

Property Value

object

FrameMargin

Gets or sets margin for a Frame of INavigationView

Thickness FrameMargin { get; set; }

Property Value

Thickness

Header

Gets or sets the header content.

object? Header { get; set; }

Property Value

object

HeaderVisibility

Gets or sets the Header visibility.

Visibility HeaderVisibility { get; set; }

Property Value

Visibility

IsBackButtonVisible

Gets or sets a value that indicates whether the back button is visible or not. Default value is "Auto", which indicates that button visibility depends on the DisplayMode setting of the NavigationView.

NavigationViewBackButtonVisible IsBackButtonVisible { get; set; }

Property Value

NavigationViewBackButtonVisible

IsBackEnabled

Gets a value indicating whether the back button is enabled or disabled.

bool IsBackEnabled { get; }

Property Value

bool

IsPaneOpen

Gets or sets a value indicating whether the NavigationView pane is expanded to its full width.

bool IsPaneOpen { get; set; }

Property Value

bool

IsPaneToggleVisible

Gets or sets a value indicating whether the toggle button is visible.

bool IsPaneToggleVisible { get; set; }

Property Value

bool

IsPaneVisible

Gets or sets a value indicating whether the pane is shown.

bool IsPaneVisible { get; set; }

Property Value

bool

ItemTemplate

Gets or sets the template property for MenuItems and FooterMenuItems.

ControlTemplate? ItemTemplate { get; set; }

Property Value

ControlTemplate

MenuItems

Gets the collection of menu items displayed in the NavigationView.

IList MenuItems { get; }

Property Value

IList

MenuItemsSource

Gets or sets an object source used to generate the content of the NavigationView menu.

object? MenuItemsSource { get; set; }

Property Value

object

OpenPaneLength

Gets or sets the width of the NavigationView pane when it's fully expanded.

double OpenPaneLength { get; set; }

Property Value

double

PaneDisplayMode

Gets or sets a value that specifies how the pane and content areas of a NavigationView are being shown.

It is not the same PaneDisplayMode as in WinUi.

NavigationViewPaneDisplayMode PaneDisplayMode { get; set; }

Property Value

NavigationViewPaneDisplayMode

PaneFooter

Gets or sets the content for the pane footer.

object? PaneFooter { get; set; }

Property Value

object

PaneHeader

Gets or sets the content for the pane header.

object? PaneHeader { get; set; }

Property Value

object

PaneTitle

Gets or sets the label adjacent to the menu icon when the NavigationView pane is open.

string? PaneTitle { get; set; }

Property Value

string

SelectedItem

Gets the selected item.

INavigationViewItem? SelectedItem { get; }

Property Value

INavigationViewItem

TitleBar

Gets or sets an TitleBar to be displayed in the NavigationView.

TitleBar? TitleBar { get; set; }

Property Value

TitleBar

Transition

Gets or sets type of INavigationView transitions during navigation.

Transition Transition { get; set; }

Property Value

Transition

TransitionDuration

Gets or sets a value deciding how long the effect of the transition between the pages should take.

int TransitionDuration { get; set; }

Property Value

int

Methods

ClearJournal()

Clears the NavigationView history.

void ClearJournal()

GoBack()

Navigates the NavigationView to the previous journal entry.

bool GoBack()

Returns

bool

true if successfully navigated backward, otherwise false.

GoForward()

Navigates the NavigationView to the next journal entry.

bool GoForward()

Returns

bool

true if successfully navigated forward, otherwise false.

Navigate(string, object?)

Synchronously navigates current navigation Frame to the given Element.

bool Navigate(string pageIdOrTargetTag, object? dataContext = null)

Parameters

pageIdOrTargetTag string
dataContext object

Returns

bool

Navigate(Type, object?)

Synchronously navigates current navigation Frame to the given Element.

bool Navigate(Type pageType, object? dataContext = null)

Parameters

pageType Type
dataContext object

Returns

bool

NavigateWithHierarchy(Type, object?)

Synchronously adds an element to the navigation stack and navigates current navigation Frame to the

bool NavigateWithHierarchy(Type pageType, object? dataContext = null)

Parameters

pageType Type
dataContext object

Returns

bool

ReplaceContent(Type)

Replaces the contents of the navigation frame, without changing the currently selected item or triggering an SelectionChanged.

bool ReplaceContent(Type pageTypeToEmbed)

Parameters

pageTypeToEmbed Type

Returns

bool

ReplaceContent(UIElement, object?)

Replaces the contents of the navigation frame, without changing the currently selected item or triggering an SelectionChanged.

bool ReplaceContent(UIElement pageInstanceToEmbed, object? dataContext = null)

Parameters

pageInstanceToEmbed UIElement
dataContext object

Returns

bool

SetPageProviderService(INavigationViewPageProvider)

Allows you to assign to the NavigationView a special service responsible for retrieving the page instances.

void SetPageProviderService(INavigationViewPageProvider navigationViewPageProvider)

Parameters

navigationViewPageProvider INavigationViewPageProvider

SetServiceProvider(IServiceProvider)

Allows you to assign a general IServiceProvider to the NavigationView that will be used to retrieve page instances and view models.

void SetServiceProvider(IServiceProvider serviceProvider)

Parameters

serviceProvider IServiceProvider

Events

BackRequested

Occurs when the back button receives an interaction such as a click or tap.

event TypedEventHandler<NavigationView, RoutedEventArgs> BackRequested

Event Type

TypedEventHandler<NavigationView, RoutedEventArgs>

ItemInvoked

Occurs when an item in the menu receives an interaction such as a click or tap.

event TypedEventHandler<NavigationView, RoutedEventArgs> ItemInvoked

Event Type

TypedEventHandler<NavigationView, RoutedEventArgs>

Navigated

Occurs when navigated to page

event TypedEventHandler<NavigationView, NavigatedEventArgs> Navigated

Event Type

TypedEventHandler<NavigationView, NavigatedEventArgs>

Navigating

Occurs when a new navigation is requested

event TypedEventHandler<NavigationView, NavigatingCancelEventArgs> Navigating

Event Type

TypedEventHandler<NavigationView, NavigatingCancelEventArgs>

PaneClosed

Occurs when the NavigationView pane is closed.

event TypedEventHandler<NavigationView, RoutedEventArgs> PaneClosed

Event Type

TypedEventHandler<NavigationView, RoutedEventArgs>

PaneOpened

Occurs when the NavigationView pane is opened.

event TypedEventHandler<NavigationView, RoutedEventArgs> PaneOpened

Event Type

TypedEventHandler<NavigationView, RoutedEventArgs>

SelectionChanged

Occurs when the currently selected item changes.

event TypedEventHandler<NavigationView, RoutedEventArgs> SelectionChanged

Event Type

TypedEventHandler<NavigationView, RoutedEventArgs>