Interface INavigator
Represents a navigator that can navigate a hierarchy of views using routes and display dialogs for an application or window.
Inherited Members
Namespace: Singulink.UI.Navigation
Assembly: Singulink.UI.Navigation.dll
Syntax
public interface INavigator : IDialogPresenter, INotifyPropertyChanged
Remarks
Navigator instances are not thread-safe and should only be accessed from the UI thread. Attempting to access methods or properties from a non-UI thread will result in an InvalidOperationException being thrown. Any exceptions to this rule are documented in method or property summaries.
Properties
| Name | Description |
|---|---|
| CanGoBack | Gets a value indicating whether the navigator can navigate back to the previous view. This property can be used to bind the enabled state of a back button in the UI and should be checked before calling GoBackAsync(). |
| CanGoForward | Gets a value indicating whether the navigator can navigate forward to the next view. This property can be used to bind the enabled state of a forward button in the UI and should be checked before calling GoForwardAsync(). |
| CanRefresh | Gets a value indicating whether the navigator can refresh the current view. This property can be used to bind the enabled state of a refresh button or "pull to refresh" feature in the UI and should be checked before calling RefreshAsync(). |
| CurrentRoute | Gets information about the current route, including the path and options. |
| HasBackHistory | Gets a value indicating whether the navigator has back history. |
| HasForwardHistory | Gets a value indicating whether the navigator has forward history. |
| IsNavigating | Gets a value indicating whether the navigator is currently in the process of navigating to a new view. |
| IsShowingDialog | Gets a value indicating whether the navigator is currently showing a dialog. |
| RootServices | Gets the root service provider for this navigator. This property can be accessed from any thread. |
| TaskRunner | Gets the task runner for this navigator. This property can be accessed from any thread. |
Methods
| Name | Description |
|---|---|
| ClearHistory() | Clears back and forward navigation history. |
| CurrentPathStartsWith<TRootViewModel>(IConcreteRootRoutePart<TRootViewModel>, IConcreteChildRoutePart<TRootViewModel>) | Determines whether the current route path starts with the same path as the specified route. |
| CurrentPathStartsWith<TRootViewModel, TChildViewModel1>(IConcreteRootRoutePart<TRootViewModel>, IConcreteChildRoutePart<TRootViewModel, TChildViewModel1>, IConcreteChildRoutePart<TChildViewModel1>) | Determines whether the current route path starts with the same path as the specified route. |
| CurrentPathStartsWith<TRootViewModel, TChildViewModel1, TChildViewModel2>(IConcreteRootRoutePart<TRootViewModel>, IConcreteChildRoutePart<TRootViewModel, TChildViewModel1>, IConcreteChildRoutePart<TChildViewModel1, TChildViewModel2>, IConcreteChildRoutePart<TChildViewModel2>) | Determines whether the current route path starts with the same path as the specified route. |
| CurrentRouteHasParent<TViewModel>() | Determines whether the current route contains a parent view with the specified view model type. |
| GetBackStack() | Returns the routes that are in the back navigation stack, ordered from the most recent to the oldest. Does not include the current route. |
| GetForwardStack() | Returns a list of routes currently in the forward navigation stack. Does not include the current route. |
| GoBackAsync() | Navigates back to the previous view. |
| GoForwardAsync() | Navigates forward to the next view. |
| HandleSystemBackRequest() | Handles a system back request, such as when the user presses the back button on a mobile device, a hardware back button on a desktop or the back button in a web browser. Returns true if there is a dialog showing, a light dismiss popup was closed, a navigation is currently in progress or if a back navigation was initiated; otherwise false (meaning there was no back history). |
| HandleSystemForwardRequest() | Handles a system forward request, such as when the user presses the forward button on a mobile device, a hardware forward button on a desktop or the forward button in a web browser. Returns true if there is a dialog showing, a navigation is currently in progress or if a forward navigation was initiated; otherwise false (meaning there was no forward history). |
| NavigateAsync(IConcreteRootRoutePart, RouteOptions?) | Navigates to the specified route. |
| NavigateAsync(string) | Navigates to the specified route. |
| NavigateAsync<TRootViewModel>(IConcreteRootRoutePart<TRootViewModel>, IConcreteChildRoutePart<TRootViewModel>, RouteOptions?) | Navigates to the specified route. |
| NavigateAsync<TRootViewModel, TChildViewModel1>(IConcreteRootRoutePart<TRootViewModel>, IConcreteChildRoutePart<TRootViewModel, TChildViewModel1>, IConcreteChildRoutePart<TChildViewModel1>, RouteOptions?) | Navigates to the specified route. |
| NavigateAsync<TRootViewModel, TChildViewModel1, TChildViewModel2>(IConcreteRootRoutePart<TRootViewModel>, IConcreteChildRoutePart<TRootViewModel, TChildViewModel1>, IConcreteChildRoutePart<TChildViewModel1, TChildViewModel2>, IConcreteChildRoutePart<TChildViewModel2>, RouteOptions?) | Navigates to the specified route. |
| NavigatePartialAsync(RouteOptions) | Navigates to a partial route that has the same path as the current route but with the specified options. |
| NavigatePartialAsync<TParentViewModel>(IConcreteChildRoutePart<TParentViewModel>, RouteOptions?) | Navigates to the specified partial route. The current route must contain a view with the specified parent view model type otherwise an InvalidOperationException is thrown. |
| NavigatePartialAsync<TParentViewModel, TChildViewModel1>(IConcreteChildRoutePart<TParentViewModel, TChildViewModel1>, IConcreteChildRoutePart<TChildViewModel1>, RouteOptions?) | Navigates to the specified partial route. The current route must contain a view with the specified parent view model type otherwise an InvalidOperationException is thrown. |
| NavigatePartialAsync<TParentViewModel, TChildViewModel1, TChildViewModel2>(IConcreteChildRoutePart<TParentViewModel, TChildViewModel1>, IConcreteChildRoutePart<TChildViewModel1, TChildViewModel2>, IConcreteChildRoutePart<TChildViewModel2>, RouteOptions?) | Navigates to the specified partial route. The current route must contain a view with the specified parent view model type otherwise an InvalidOperationException is thrown. |
| NavigateToParentAsync<TParentViewModel>(RouteOptions?) | Navigates to the parent view in the current route that has the specified view model type. |
| RefreshAsync() | Refreshes the current route. |
| TryShutDownAsync() | Shuts down the navigator by releasing all views and view model resources. Returns false if shutdown, navigation or busy tasks are in progress, dialogs are showing, or any view models are preventing navigating away from the current view; otherwise returns true after successfully shutting down. |