UI Tookit UI Tookit
UI Tookit UI Tookit
DocFX + Singulink = ♥

Search Results for

    Class Navigator

    Represents a navigator that can navigate a hierarchy of views using routes and display dialogs for an application or window.

    Inheritance
    object
    Navigator
    Implements
    INavigator
    IDialogNavigatorBase
    INotifyPropertyChanged
    Namespace: Singulink.UI.Navigation
    Assembly: Singulink.UI.Navigation.WinUI.dll
    Syntax
    public class Navigator : INavigator, IDialogNavigatorBase, 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.

    Constructors

    Name Description
    Navigator(ContentControl, Action<NavigatorBuilder>)

    Initializes a new instance of the Navigator class with the specified root content control and mappings provided in the build action.

    Navigator(Panel, Action<NavigatorBuilder>)

    Initializes a new instance of the Navigator class with the specified root panel and mappings provided in the build action.

    Navigator(IViewNavigator, Action<NavigatorBuilder>)

    Initializes a new instance of the Navigator class with the specified root view navigator and mappings provided in the build action.

    Properties

    Name Description
    CanUserGoBack

    Gets a value indicating whether the navigator can navigate back to the previous view from a user-initiated request. This property can be used to bind the enabled state of a back button in the UI.

    CanUserGoForward

    Gets a value indicating whether the navigator can navigate forward to the next view from a user-initiated request. This property can be used to bind the enabled state of a forward button in the UI.

    CanUserRefresh

    Gets a value indicating whether the navigator can refresh the current view from a user-initiated request. This property can be used to bind the enabled state of a refresh button or "pull to refresh" feature in the UI.

    HasBackHistory

    Gets a value indicating whether the navigator has back history. This property should be checked prior to doing a programmatic back navigation.

    HasForwardHistory

    Gets a value indicating whether the navigator has forward history. This property should be checked prior to doing a programmatic forward navigation.

    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.

    Methods

    Name Description
    GetRouteOptions()

    Gets the route options for the current route.

    GoBackAsync(bool)

    Navigates back to the previous view.

    GoForwardAsync(bool)

    Navigates forward to the next view.

    NavigateAsync(string)

    Navigates to the specified route.

    NavigateAsync<TViewModel>(ISpecifiedRootRoute<TViewModel>, RouteOptions?)

    Navigates to the specified route.

    NavigateAsync<TParentViewModel, TNestedViewModel>(ISpecifiedRootRoute<TParentViewModel>, ISpecifiedNestedRoute<TParentViewModel, TNestedViewModel>, RouteOptions?)

    Navigates to the specified route.

    NavigateAsync<TParentViewModel, TNestedViewModel1, TNestedViewModel2>(ISpecifiedRootRoute<TParentViewModel>, ISpecifiedNestedRoute<TParentViewModel, TNestedViewModel1>, ISpecifiedNestedRoute<TNestedViewModel1, TNestedViewModel2>, RouteOptions?)

    Navigates to the specified route.

    NavigateAsync<TParentViewModel, TNestedViewModel1, TNestedViewModel2, TNestedViewModel3>(ISpecifiedRootRoute<TParentViewModel>, ISpecifiedNestedRoute<TParentViewModel, TNestedViewModel1>, ISpecifiedNestedRoute<TNestedViewModel1, TNestedViewModel2>, ISpecifiedNestedRoute<TNestedViewModel2, TNestedViewModel3>, 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, TNestedViewModel>(ISpecifiedNestedRoute<TParentViewModel, TNestedViewModel>, 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, TNestedViewModel1, TNestedViewModel2>(ISpecifiedNestedRoute<TParentViewModel, TNestedViewModel1>, ISpecifiedNestedRoute<TNestedViewModel1, TNestedViewModel2>, 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, TNestedViewModel1, TNestedViewModel2, TNestedViewModel3>(ISpecifiedNestedRoute<TParentViewModel, TNestedViewModel1>, ISpecifiedNestedRoute<TNestedViewModel1, TNestedViewModel2>, ISpecifiedNestedRoute<TNestedViewModel2, TNestedViewModel3>, 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.

    RefreshAsync(bool)

    Refreshes the current route.

    RegisterAsyncNavigationTaskReceiver(Action<Task>)

    Registers a task receiver that gets invoked whenever an asynchronous navigation occurs. The task passed into the receiver completes at the end of the navigation.

    ShowDialogAsync<TViewModel>(Func<IDialogNavigator, TViewModel>)

    Shows a dialog with the view model created by the specified function and returns a task that contains the view model when the dialog closes.

    ShowDialogAsync<TViewModel>(TViewModel, out IDialogNavigator)

    Shows a dialog with the specified view model and returns a task that completes when the dialog closes.

    ShowDialogAsync<TViewModel>(out TViewModel, Func<IDialogNavigator, TViewModel>)

    Shows a dialog with the view model created by the specified function and returns a task that completes when the dialog closes.

    TryGetRouteParameter<TParam, TViewModel>(RouteBase<TParam, TViewModel>, out TParam)

    Gets the route parameter from the current route.

    TryGetRouteViewModel<TViewModel>(out TViewModel)

    Returns the last view model that matches the specified view model type from the current route. Can only be used to reliably get parent view models since child view models may have not been initialized yet.

    UnregisterAsyncNavigationTaskReceiver(Action<Task>)

    Unregisters a task receiver that was previously registered with RegisterAsyncNavigationTaskReceiver(Action<Task>).

    Events

    Name Description
    PropertyChanged

    Occurs when a property value changes.

    Extension Methods

    DialogNavigatorExtensions.ShowMessageDialogAsync(IDialogNavigatorBase, MessageDialogOptions)
    DialogNavigatorExtensions.ShowMessageDialogAsync(IDialogNavigatorBase, string, IEnumerable<string>)
    DialogNavigatorExtensions.ShowMessageDialogAsync(IDialogNavigatorBase, string, string, IEnumerable<string>)
    DialogNavigatorExtensions.ShowMessageDialogAsync(IDialogNavigatorBase, string, string)
    DialogNavigatorExtensions.ShowMessageDialogAsync(IDialogNavigatorBase, string)
    © Singulink. All rights reserved.