Exemplo n.º 1
0
 /// <summary>
 /// Creates a new <see cref="WpfViewProvider"/>.
 /// </summary>
 public WpfViewProvider(INavigationHistory history)
 {
     History = history;
 }
Exemplo n.º 2
0
 public NavigationWindow(INavigationHistory?history = null)
 {
     this.history = history ?? new NoNavigationHistory();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Gets the <see cref="Type"/> of the view-model active in the current <see cref="INavigationLayer"/> of the navigation history.
 /// </summary>
 /// <param name="history">The <see cref="INavigationHistory"/> being queried.</param>
 /// <returns>The <see cref="Type"/> of the currently active view-model, or 'null' if no active view-model was found.</returns>
 public static Type GetActiveViewModelType(this INavigationHistory history)
 {
     return(history.CurrentLayer.CurrentViewModel?.GetType());
 }
Exemplo n.º 4
0
 /// <summary>
 /// Retrieves a collection of all active <see cref="IViewModel"/>s in all <see cref="INavigationLayer"/>s of the navigation history.
 /// </summary>
 /// <param name="history">The <see cref="INavigationHistory"/> being queried.</param>
 /// <returns>A collection of all non-null <see cref="INavigationLayer.CurrentViewModel"/>s for all navigation history layers.</returns>
 public static IEnumerable <IViewModel> GetActiveViewModels(this INavigationHistory history)
 {
     return(history.Layers.Select(l => l.CurrentViewModel).Where(v => v != null));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Creates a new <see cref="BaseCommandRouter"/>.
 /// </summary>
 public BaseCommandRouter(INavigationHistory navigationHistory, IEnumerable <ICommandProvider> commandProviders)
 {
     NavigationHistory = navigationHistory;
     CommandProviders  = commandProviders;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Creates a new <see cref="NavigationService"/> from the provided services.
 /// </summary>
 public NavigationService(IViewProvider viewProvider, INavigationHistory history, ILifetimeScope scope)
 {
     ViewProvider  = viewProvider;
     History       = history;
     LifetimeScope = scope;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Creates a new <see cref="UwpViewProvider"/>.
 /// </summary>
 public UwpViewProvider(IEnumerable <IDispatcher> dispatchers, INavigationHistory history)
 {
     UILayers    = new List <ContentControl>();
     Dispatchers = dispatchers;
     History     = history;
 }