Show / Hide Table of Contents

Class NavigationService

Used to programmatically initiate navigation, primarily from within a Page.

Inheritance
System.Object
NavigationService
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Navigation
Assembly: OpenSilver.Controls.Navigation.dll
Syntax
public sealed class NavigationService

Properties

| Improve this Doc View Source

CanGoBack

Gets a value used to determine if there are any entries on the back stack

Declaration
public bool CanGoBack { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

CanGoForward

Gets a value used to determine if there are any entries on the forward stack

Declaration
public bool CanGoForward { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

CurrentSource

Gets the Uri of the content currently hosted in the Frame.

Declaration
public Uri CurrentSource { get; }
Property Value
Type Description
System.Uri
Remarks

This value may be different from Source if Source is set and the navigation has not yet completed. CurrentSource reflects the page currently in the frame at all times, even when an async loading operation is in progress.

| Improve this Doc View Source

Source

Gets or sets the Uri of the content currently hosted in the Frame.

Declaration
public Uri Source { get; set; }
Property Value
Type Description
System.Uri
Remarks

This value may be different from CurrentSource if Source is set and the navigation has not yet completed. CurrentSource reflects the page currently in the frame at all times, even when an async loading operation is in progress.

Methods

| Improve this Doc View Source

GoBack()

Navigate to the previous entry in the Journal

Declaration
public void GoBack()
| Improve this Doc View Source

GoForward()

Navigate to the next entry in the Journal

Declaration
public void GoForward()
| Improve this Doc View Source

Navigate(Uri)

Navigate to source

Declaration
public bool Navigate(Uri source)
Parameters
Type Name Description
System.Uri source

The Uri to begin navigating to

Returns
Type Description
System.Boolean

Always returns true.

| Improve this Doc View Source

Refresh()

Refreshes the current page

Declaration
public void Refresh()
| Improve this Doc View Source

StopLoading()

StopLoading aborts asynchronous navigations that haven't been processed yet. The NavigationStopped event is raised only if the navigation was actually aborted - if navigation is too far along to be canceled, then navigation may still complete and the Navigated event will be raised.

Declaration
public void StopLoading()

Events

| Improve this Doc View Source

FragmentNavigation

Occurs when a navigation occurs within a page.

Declaration
public event FragmentNavigationEventHandler FragmentNavigation
Event Type
Type Description
FragmentNavigationEventHandler
| Improve this Doc View Source

Navigated

Occurs when the NavigationService has navigated.

Declaration
public event NavigatedEventHandler Navigated
Event Type
Type Description
NavigatedEventHandler
| Improve this Doc View Source

Navigating

Occurs when the NavigationService is starting to navigate.

Declaration
public event NavigatingCancelEventHandler Navigating
Event Type
Type Description
NavigatingCancelEventHandler
| Improve this Doc View Source

NavigationFailed

Occurs when the an exception is raised during navigation.

Declaration
public event NavigationFailedEventHandler NavigationFailed
Event Type
Type Description
NavigationFailedEventHandler
| Improve this Doc View Source

NavigationStopped

Occurs when a navigation operation has been cancelled.

Declaration
public event NavigationStoppedEventHandler NavigationStopped
Event Type
Type Description
NavigationStoppedEventHandler
  • Improve this Doc
  • View Source