Table of Contents

Interface INavigationService

Namespace
Wpf.Ui
Assembly
Wpf.Ui.dll

Represents a contract with a FrameworkElement that contains INavigationView. Through defined INavigationViewPageProvider service allows you to use the Dependency Injection pattern in WPF UI navigation.

public interface INavigationService
Extension Methods

Methods

GetNavigationControl()

Provides direct access to the control responsible for navigation.

INavigationView GetNavigationControl()

Returns

INavigationView

Instance of the INavigationView control.

GoBack()

Navigates the NavigationView to the previous journal entry.

bool GoBack()

Returns

bool

true if the operation succeeds. false otherwise.

Navigate(string)

Lets you navigate to the selected page based on it's tag. Should be used with INavigationViewPageProvider.

bool Navigate(string pageIdOrTargetTag)

Parameters

pageIdOrTargetTag string

Id or tag of the page.

Returns

bool

true if the operation succeeds. false otherwise.

Navigate(string, object?)

Lets you navigate to the selected page based on it's tag. Should be used with INavigationViewPageProvider.

bool Navigate(string pageIdOrTargetTag, object? dataContext)

Parameters

pageIdOrTargetTag string

Id or tag of the page.

dataContext object

DataContext object

Returns

bool

true if the operation succeeds. false otherwise.

Navigate(Type)

Lets you navigate to the selected page based on it's type. Should be used with INavigationViewPageProvider.

bool Navigate(Type pageType)

Parameters

pageType Type

Type of the page.

Returns

bool

true if the operation succeeds. false otherwise.

Navigate(Type, object?)

Lets you navigate to the selected page based on it's type, Should be used with INavigationViewPageProvider.

bool Navigate(Type pageType, object? dataContext)

Parameters

pageType Type

Type of the page.

dataContext object

DataContext object

Returns

bool

true if the operation succeeds. false otherwise.

NavigateWithHierarchy(Type)

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

bool NavigateWithHierarchy(Type pageType)

Parameters

pageType Type

Type of control to be synchronously added to the navigation stack

Returns

bool

true if the operation succeeds. false otherwise.

NavigateWithHierarchy(Type, object?)

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

bool NavigateWithHierarchy(Type pageType, object? dataContext)

Parameters

pageType Type

Type of control to be synchronously added to the navigation stack

dataContext object

DataContext object

Returns

bool

true if the operation succeeds. false otherwise.

SetNavigationControl(INavigationView)

Lets you attach the control that represents the INavigationView.

void SetNavigationControl(INavigationView navigation)

Parameters

navigation INavigationView

Instance of the INavigationView.