INavigationService interface¶
Defined in
Namespace: CrissCross.Avalonia.UI
Assembly: CrissCross.Avalonia.UI.dll
Full name: CrissCross.Avalonia.UI.INavigationService
Modifiers: public abstract
Summary¶
Defines a contract for navigation services that manage navigation between pages or views within an application.
Provides methods to navigate to pages by type or tag, manage the navigation stack, and interact with the navigation
control and page service.
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net471
Remarks¶
Implementations of this interface enable decoupled navigation logic, allowing view models or other components to initiate navigation without direct references to UI elements. The interface supports navigation with or without associated data contexts and provides methods for hierarchical navigation scenarios. It is typically used in conjunction with an IPageService to resolve page instances and an INavigationView control to present navigation UI.
Methods¶
| Name | Summary |
|---|---|
| Navigate | Lets you navigate to the selected page based on it's type. Should be used with [IPageService](# |
| NavigateWithHierarchy | Synchronously adds an element to the navigation stack and navigates current navigation Frame to the page represented by the element. |
| GetNavigationControl | Provides direct access to the control responsible for navigation. |
| SetNavigationControl | Lets you attach the control that represents the [INavigationView](# |
| SetPageService | Lets you attach the service that delivers page instances to [INavigationView](# |
| GoBack | Navigates the NavigationView to the previous journal entry. |
| GoForward | Navigates the NavigationView to the next journal entry. |