Table of Contents

Class NavigationService

Namespace
Wpf.Ui
Assembly
Wpf.Ui.dll

A service that provides methods related to navigation.

public class NavigationService : INavigationService
Inheritance
NavigationService
Implements
Inherited Members
Extension Methods

Constructors

NavigationService(INavigationViewPageProvider)

A service that provides methods related to navigation.

public NavigationService(INavigationViewPageProvider pageProvider)

Parameters

pageProvider INavigationViewPageProvider

Properties

NavigationControl

Gets or sets the control representing navigation.

protected INavigationView? NavigationControl { get; set; }

Property Value

INavigationView

Methods

GetNavigationControl()

Provides direct access to the control responsible for navigation.

public INavigationView GetNavigationControl()

Returns

INavigationView

Instance of the INavigationView control.

GoBack()

Navigates the NavigationView to the previous journal entry.

public 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.

public bool Navigate(string pageTag)

Parameters

pageTag string

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.

public bool Navigate(string pageTag, object? dataContext)

Parameters

pageTag string
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.

public 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.

public 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

public 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

public 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.

public void SetNavigationControl(INavigationView navigation)

Parameters

navigation INavigationView

Instance of the INavigationView.

ThrowIfNavigationControlIsNull()

protected void ThrowIfNavigationControlIsNull()