Table of Contents

Interface IViewModelRouteCache

Namespace
Blazing.Mvvm.Components.Routing
Assembly
Blazing.Mvvm.dll

Defines the contract for a cache that stores mappings between ViewModel types or keys and their associated route URIs.

public interface IViewModelRouteCache

Properties

KeyedViewModelRouteTemplates

Gets the cached route template collections for keyed ViewModels, mapping navigation keys to RouteTemplateCollection.

IReadOnlyDictionary<object, RouteTemplateCollection> KeyedViewModelRouteTemplates { get; }

Property Value

IReadOnlyDictionary<object, RouteTemplateCollection>

Remarks

This property supports multi-route template navigation for keyed ViewModels, enabling components registered with a navigation key to define multiple route patterns.

Similar to ViewModelRouteTemplates, this allows smart route selection based on the navigation parameters provided when navigating by key.

KeyedViewModelRoutes

Gets the cached routes for keyed ViewModels, mapping navigation keys to route URI String.

IReadOnlyDictionary<object, string> KeyedViewModelRoutes { get; }

Property Value

IReadOnlyDictionary<object, string>

ViewModelRouteTemplates

Gets the cached route template collections for ViewModels, mapping ViewModel Type to RouteTemplateCollection.

IReadOnlyDictionary<Type, RouteTemplateCollection> ViewModelRouteTemplates { get; }

Property Value

IReadOnlyDictionary<Type, RouteTemplateCollection>

Remarks

This property supports multi-route template navigation, allowing ViewModels with multiple @page directives to have all their route templates cached and available for smart template selection during navigation.

When a component has multiple routes (e.g., @page "/test" and @page "/test/{echo}"), the collection contains all parsed templates along with metadata to select the most appropriate route based on the navigation parameters provided.

ViewModelRoutes

Gets the cached routes for ViewModels, mapping ViewModel Type to route URI String.

IReadOnlyDictionary<Type, string> ViewModelRoutes { get; }

Property Value

IReadOnlyDictionary<Type, string>