Routeables 1.0.0

dotnet add package Routeables --version 1.0.0
                    
NuGet\Install-Package Routeables -Version 1.0.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" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Routeables" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Routeables" />
                    
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 --version 1.0.0
                    
#r "nuget: Routeables, 1.0.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@1.0.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&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Routeables&version=1.0.0
                    
Install as a Cake Tool

Routeables

Routing between view models for Blazor, .NET MAUI, Avalonia, Uno and WPF. This package is what the hosts share, and an application gets it through the package of its host (Routeables.Razor, Routeables.Maui, Routeables.Avalonia, Routeables.Uno, Routeables.Wpf). Targets .NET 10.

It is one package built from several projects of the repository:

Part What it holds
Abstraction The contracts (IRouter, IRouteable, route arguments) and the attributes that declare routes
Routing The router: history, route locking, registration
Core (this folder) The view-model bases that know about routing, and information about the runtime
Regions Several areas of the screen, each with its own history
Segments Routing by segments (/Bears?SearchText=polar)
Locking Pages that block leaving, a locked menu
Services The contracts of the dialogs, notifications and theme (the host packages implement them)
Generated The source generator, as an analyzer: AddGeneratedRoutes() and the typed GoTo…Async methods

Which base?

You write Derive from
A page nothing: a plain class that takes IRouter (add IRouteable for CanLeaveAsync, OnEnteringAsync...)
The menu or tab bar MainViewModelBase: return the entries from GetRouteables()
The menu, with CommunityToolkit.Mvvm or ReactiveUI RouteableViewModel (feature ;CommunityToolkit; or ;ReactiveUI;)
A view model shown in a dialog, closing with a result CloseableViewModel<TResult> (CommunityToolkit or ReactiveUI) or CloseableViewModelBase<TResult>
Your own base (another MVVM library) RouteableViewModelBase for a menu, RouterViewModelBase for back and forward only

Register the menu with UseRouteables<MainViewModel>(...) on your host, or services.RegisterMainViewModel<MainViewModel>(). The host chooses the lifetime (Scoped per circuit on Blazor, Singleton elsewhere). It implements IMainViewModel: the entries, the selected one, the current view, and the guard that stops a change of entry while a page blocks leaving. To write your own instead, IMainViewModel asks for five members (Routeables, Routeable, CurrentView and the events CurrentViewChanged and LockChanged); the title, Lock/Unlock and the first selection have defaults, and NotifyLockChanged is where your class raises LockChanged.

None of the bases implements INotifyPropertyChanged (MainViewModelBase, RouteableViewModelBase, CloseableViewModelBase, RouterViewModelBase): the class that derives from one must. Put [INotifyPropertyChanged] (or [ObservableObject]) of CommunityToolkit.Mvvm or [IReactiveObject] of ReactiveUI on your partial class, or implement the interface by hand, and override NotifyPropertyChanged and RaiseCanExecutesChanged. Those generators add the interface only once in a hierarchy, which is why the bases leave it to you; RouteableViewModel and CloseableViewModel<TResult> (the flavours) already do it.

The CommunityToolkit.Mvvm and ReactiveUI flavours are opt-in sources, not part of the assembly. Declare the flavour in the project file: Routeables.targets adds its sources and the packages it uses.

<PropertyGroup>
  <RouteablesFeatures>;CommunityToolkit;</RouteablesFeatures>   
</PropertyGroup>

Routeables.targets also adds the packages the flavour uses (CommunityToolkit.Mvvm; ReactiveUI and ReactiveUI.SourceGenerators), unless your project already references them: then your version wins. With central package management (ManagePackageVersionsCentrally) nothing is added: declare the packages in your Directory.Packages.props. To choose another version without referencing the package, set RouteablesCommunityToolkitMvvmVersion, RouteablesReactiveUIVersion or RouteablesReactiveUISourceGeneratorsVersion.

Runtime information

Runtime, Desktop and Distribution describe the host, the operating-system family and the distribution. Each host registers them; by hand: services.RegisterEnvironments(Runtime.Avalonia). The values are Avalonia, Maui, MauiHybrid, BlazorServer, BlazorWebAssembly, Uno and Unknown.

Related: hosts, getting started.

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 (5)

Showing the top 5 NuGet packages that depend on Routeables:

Package Downloads
Routeables.Maui

Routeables for .NET MAUI: view-model-first routing, Shell integration, routed views, regions, dialogs and notifications.

Routeables.Wpf

Routeables for WPF: view-model-first routing, routed views, regions, dialogs and notifications.

Routeables.Uno

Routeables for Uno Platform: view-model-first routing, routed views, regions, dialogs and notifications.

Routeables.Razor

Routeables for Blazor: view-model-first routing, routed components, regions, dialogs, notifications and the default layout.

Routeables.Avalonia

Routeables for Avalonia: view-model-first routing, routed views, regions, dialogs and notifications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 103 10/25/2026