public sealed class NavigationRouteMapBuilder Declares the routes of a NavigationRouteMap.
Remarks
Each Map method checks its template at once and throws ArgumentException for a malformed template, a parameter type the method can't pass, or a parameter declared twice.
Constructors
NavigationRouteMapBuilder
public NavigationRouteMapBuilder() No documentation.
Methods
Build
public NavigationRouteMap Build() Builds the map. The builder can be used again; later routes don't change a built map.
Map
public NavigationRouteMapBuilder Map<T>(string template) where T : class Maps a template without parameters to NavigationTarget.Create. An entry whose content is exactly a T created without input has this route.
Type parameters
TThe content type the navigator constructs.
Parameters
templateThe route template, such as
customers.
Map
public NavigationRouteMapBuilder Map<T, TInput>(string template) where T : class, INavigationInput<TInput> Maps a template with one parameter to NavigationTarget.Create, passing the parameter's value as the input. An entry whose content is exactly a T created with a TInput input has this route.
Type parameters
TThe content type the navigator constructs.
TInputThe parameter's type:
Int32,Int64,String,GuidorBoolean, matching the template's constraint.
Parameters
templateThe route template, such as
customers/{id:int}.
Map
public NavigationRouteMapBuilder Map<T, TInput>(string template, Func<NavigationRouteValues, TInput> read, Func<TInput, NavigationRouteValues?> write) where T : class, INavigationInput<TInput> Maps a template to NavigationTarget.Create with an input read from the parameters, such as a record of a customer and an invoice number. An entry whose content is exactly a T created with a TInput input has this route, with the parameters write gives.
Type parameters
TThe content type the navigator constructs.
TInputThe input type.
Parameters
templateThe route template, such as
customers/{id:int}/invoices/{invoice:int}.readCreates the input from the parameter values.
writeGives the parameter values of an input, or
nullwhen the route doesn't describe it.
Map
public NavigationRouteMapBuilder Map<T>(string template, Func<IServiceProvider, NavigationRouteValues, INavigationTarget<T>?> target, Func<T, NavigationRouteValues?> values) where T : class Maps a template to targets that target creates, such as a borrowed page from the window's services or a factory with a NavigationEntryContext. An entry whose content is a T has this route when values returns its parameter values.
Type parameters
TThe content type.
Parameters
templateThe route template.
targetCreates the target from the navigator's
RunicNavigator.Services(an empty provider without them) and the parameter values; it must not construct content (use aCreatetarget) unless it borrows it. Returnnullto let a later route match.valuesGives the parameter values of an entry's content, an empty
NavigationRouteValuesfor a template without parameters, ornullwhen the route doesn't describe it.