Class NavigationService
Used to programmatically initiate navigation, primarily from within a Page.
Inheritance
Inherited Members
Namespace: System.Windows.Navigation
Assembly: Controls.Navigation.OpenSilver.dll
Syntax
public sealed class NavigationService
Properties
| Improve this Doc View SourceCanGoBack
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 |
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 |
CurrentSource
Gets the Uri of the content currently hosted in the Frame.
Declaration
public Uri CurrentSource { get; }
Property Value
Type | Description |
---|---|
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.
Source
Gets or sets the Uri of the content currently hosted in the Frame.
Declaration
public Uri Source { get; set; }
Property Value
Type | Description |
---|---|
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 SourceGoBack()
Navigate to the previous entry in the Journal
Declaration
public void GoBack()
GoForward()
Navigate to the next entry in the Journal
Declaration
public void GoForward()
Navigate(Uri)
Navigate to source
Declaration
public bool Navigate(Uri source)
Parameters
Type | Name | Description |
---|---|---|
Uri | source | The Uri to begin navigating to |
Returns
Type | Description |
---|---|
System.Boolean | Always returns true. |
Refresh()
Refreshes the current page
Declaration
public void Refresh()
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 SourceFragmentNavigation
Occurs when a navigation occurs within a page.
Declaration
public event FragmentNavigationEventHandler FragmentNavigation
Event Type
Type | Description |
---|---|
FragmentNavigationEventHandler |
Navigated
Occurs when the NavigationService has navigated.
Declaration
public event NavigatedEventHandler Navigated
Event Type
Type | Description |
---|---|
NavigatedEventHandler |
Navigating
Occurs when the NavigationService is starting to navigate.
Declaration
public event NavigatingCancelEventHandler Navigating
Event Type
Type | Description |
---|---|
NavigatingCancelEventHandler |
NavigationFailed
Occurs when the an exception is raised during navigation.
Declaration
public event NavigationFailedEventHandler NavigationFailed
Event Type
Type | Description |
---|---|
NavigationFailedEventHandler |
NavigationStopped
Occurs when a navigation operation has been cancelled.
Declaration
public event NavigationStoppedEventHandler NavigationStopped
Event Type
Type | Description |
---|---|
NavigationStoppedEventHandler |