Interface IRoutedViewModelBase
Represents a view model that can be navigated to.
Namespace: Singulink.UI.Navigation
Assembly: Singulink.UI.Navigation.dll
Syntax
public interface IRoutedViewModelBase
Properties
| Name | Description |
|---|---|
| CanBeCached | Gets a value indicating whether the view model and its associated view can be cached in the navigation stacks. |
Methods
| Name | Description |
|---|---|
| OnNavigatedAwayAsync() | Called when the view model is navigated away from. |
| OnNavigatedToAsync(NavigationArgs) | Called when the view model is navigated to (i.e. becomes visible). May be called multiple times on the same view model instance if the view model is navigated away from but still cached when a route containing the view model is navigated to again. Calls are always paired with future calls to OnNavigatedAwayAsync(). |
| OnNavigatingAwayAsync(NavigatingArgs) | Called when the view model is being navigated away from. Can be used to cancel the new navigation (e.g. if there is unsaved data). |
| OnRouteNavigatedAsync(NavigationArgs) | Called whenever a route that contains the view model is navigated to, even if the view model was already active in the previous route. If the view model was not already active in the previous route then it will be called after OnNavigatedToAsync(NavigationArgs), and any time the route is refreshed or changed while the view model remains active in the new route. |
| OnRouteNavigatingAsync(NavigatingArgs) | Called whenever the view model is active in the current route and a new route is being navigated to, even if the view model will remain active in the new route. If the view model will not remain active in the new route then it will be called after OnNavigatingAwayAsync(NavigatingArgs). |