Routeables.Abstraction 2.1.0

dotnet add package Routeables.Abstraction --version 2.1.0
                    
NuGet\Install-Package Routeables.Abstraction -Version 2.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Routeables.Abstraction" Version="2.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Routeables.Abstraction" Version="2.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Routeables.Abstraction" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Routeables.Abstraction --version 2.1.0
                    
#r "nuget: Routeables.Abstraction, 2.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Routeables.Abstraction@2.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Routeables.Abstraction&version=2.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Routeables.Abstraction&version=2.1.0
                    
Install as a Cake Tool

Routeables.Abstraction

The contracts of Routeables. View models and views depend on these types instead of an API of Blazor, ASP.NET Core, .NET MAUI, Avalonia, Uno Platform, WinUI 3 or WPF, so the same routing code runs on all seven hosts.

The router itself is in Routeables.Routing, the platform services are in the host packages. Targets .NET 10; its only package is Microsoft.Extensions.DependencyInjection.Abstractions.

It is a package of its own, Routeables.Abstraction, for a library that only declares view models, routes or modules: dotnet add package Routeables.Abstraction. The Routeables package, which every host package brings, depends on exactly the same version, so an application needs dotnet add package Routeables.Avalonia (or the package of your host) and nothing else.

Route from a view model

A view model depends only on IRouter:

using Routeables.Abstraction.Routing;

public class DogsViewModel(IRouter router)
{
    public async Task OpenDogAsync(string name)
    {
        RouteableResult result = await router.GoToAsync($"/dogs/{Uri.EscapeDataString(name)}");
        if (!result.Success && !result.Cancelled)
            throw new InvalidOperationException(result.Exception?.Message);
    }
}

IRouter also offers GoBackAsync, ForwardAsync, PopAsync, GoBackToRootAsync, MoveToAsync and EraseHistoryAsync. A route change that cannot happen (an unknown address, a page that vetoes leaving) returns a failed or cancelled RouteableResult and does not throw.

Namespaces

The types are in sub-namespaces of Routeables.Abstraction; add the using of the area you touch.

Namespace Holds
Routeables.Abstraction [Routeable], [RouteableView], [RouteableViewModel], [RouteableParameter], modules (IRouteableModules), menu entries (AddMenuEntries)
.Routing IRouter, IRouteableArgs, RouteableResult, IRouteableReturnsResult<T>, the routing events, RouterExtensions
.Bases IRouteableMenuEntry, IRouteableMenuViewModel, ICloseableViewModel
.Lifecycle IRouteable, IRouteableViewBinder, RouteableHostLifetime
.History IHistoryEntry
.Guards IRouteGuard, RouteGuardDecision
.Transitions RouteTransition
.Injections IRouteableInjection and the property injection
.Initializers IRouteableTypedInitializer
.Registrations RegisterRoute<TView, TViewModel>, RouteableAutoRegistration
.Errors IRouteableErrorSink, RouteableErrors
.Locking IRouteableLockCoordinator, IRouteableLockCoordinatorFactory
.Icons IRouteableIconProvider

What is in it

Area Main types
Router IRouter, IRouterHistory, RouteableResult, RouteableRoutingEventArgs, RouteableRoutedEventArgs
Routes [Routeable], [RouteableView], [RouteableViewModel], RegisterRoute<TView, TViewModel>
Lifecycle IRouteable (every member has a default), IInitializeAsync, IRouteableReturnsResult<T>
Arguments IRouteableArgs (values for the view model, for the view, neutral ones), RouteableParameterAttribute
Menu IRouteableMenuEntry, IRouteableMenuViewModel, AddMenuEntries, IRouteableModules (modules loaded while running)
Errors and locks IRouteableErrorSink, RouteableErrors, IRouteableLockCoordinator, IRouteableFormLock (lock the menu while a form is edited)

The dialogs, notifications and theme are in Routeables.Services, regions in Routeables.Regions, segments in Routeables.Segments: a project that only routes carries none of them.

Go further

Routes and templates, typed routing methods, arguments, lifecycle and guards, history.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Routeables.Abstraction:

Package Downloads
Routeables

Routing between view models for Blazor, ASP.NET Core, .NET MAUI, Avalonia, Uno Platform, WinUI 3 and WPF: routes declared by attributes and registered by a source generator, regions, segments, page locking, and the contracts of the dialog and notification services. Add the package of your host (Routeables.Blazor, Routeables.AspNetCore, Routeables.Maui, Routeables.Avalonia, Routeables.Uno, Routeables.WinUI3 or Routeables.Wpf) to use it.

Routeables.AspNetCore

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.0 725 11/11/2026