RouteNavigator.Core 1.3.1

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package RouteNavigator.Core --version 1.3.1
                    
NuGet\Install-Package RouteNavigator.Core -Version 1.3.1
                    
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="RouteNavigator.Core" Version="1.3.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RouteNavigator.Core" Version="1.3.1" />
                    
Directory.Packages.props
<PackageReference Include="RouteNavigator.Core" />
                    
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 RouteNavigator.Core --version 1.3.1
                    
#r "nuget: RouteNavigator.Core, 1.3.1"
                    
#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 RouteNavigator.Core@1.3.1
                    
#: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=RouteNavigator.Core&version=1.3.1
                    
Install as a Cake Addin
#tool nuget:?package=RouteNavigator.Core&version=1.3.1
                    
Install as a Cake Tool

RouteNavigator.Core

RouteNavigator.Core is a type-safe navigation library for C# applications that simplifies defining and using route-based navigation. It combines an abstraction for navigation (INavigator / AbstractNavigator) with a source generator that turns annotated route definitions into strongly-typed routes and argument objects.

Installation

dotnet add package RouteNavigator.Core

Getting Started

Design your routes

Mark a static partial class with RouteGenerator.Core.RoutesAttribute and declare partial methods that represent your routes.

using RouteGenerator.Core;

[Routes]
public static partial class Routes
{
    public static partial RootNode Home();
    public static partial RouteNode Details(Guid id);
}

Generated Code

The source generator creates strongly-typed argument records and route factories.

public record DetailsArgs(global::System.Guid Id) : global::RouteNavigator.Core.IRouteArgs
{
    public static DetailsArgs FromDictionary(global::System.Collections.Generic.Dictionary<string, object> dictionary)
    {
        var id = (global::System.Guid)dictionary[nameof(Id)];
        return new DetailsArgs(id);
    }

    public global::System.Collections.Generic.Dictionary<string, object?> ToDictionary()
    {
        return new global::System.Collections.Generic.Dictionary<string, object?>
        {
            [nameof(Id)] = this.Id
        };
    }
}
public record HomeArgs() : global::RouteNavigator.Core.IRouteArgs
{
    public static HomeArgs FromDictionary(global::System.Collections.Generic.Dictionary<string, object> dictionary)
    {
        return new HomeArgs();
    }

    public global::System.Collections.Generic.Dictionary<string, object?> ToDictionary()
    {
        return new global::System.Collections.Generic.Dictionary<string, object?>
        {
        };
    }
}
public static partial class Routes
{
    public static class Values
    {
        public const string HomeRoute = "Home";
        public const string DetailsRoute = "Details";
    }

    public static partial global::RouteNavigator.Core.RootNode Home()
    {
        return new global::RouteNavigator.Core.RootNode(Values.HomeRoute, new HomeArgs());
    }

    public static partial global::RouteNavigator.Core.RouteNode Details(global::System.Guid id)
    {
        return new global::RouteNavigator.Core.RouteNode(Values.DetailsRoute, new DetailsArgs(id));
    }
}

Now you can call

var home = Routes.Home();
var details = Routes.Details(guid);

To integrate with your application, you can implement the INavigator or IAsyncNavigator interfaces, or inherit from AbstractNavigator or AbstractAsyncNavigator.

INavigator navigator = ...;
navigator.NavigateTo(Routes.Home);

You can also pass multiple routes as a more consise navigation stack

navigator.NavigateTo(Routes.Home, Routes.Details(guid));

You can also define root routes, with which should replace the previous navigation stack.

public static partial RootNode MainRoute()
{
    return new RootNode(Values.RootRoute, new RootArgs());
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on RouteNavigator.Core:

Package Downloads
RouteNavigator.Maui

A strongly-typed route navigation library with source generator support.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0-alpha.4 75 8/22/2026
3.0.0-alpha.3 79 4/7/2026
2.0.0-alpha.3 196 10/27/2025
2.0.0-alpha.2 161 10/21/2025
2.0.0-alpha.1 166 10/8/2025
1.3.1 233 10/8/2025
1.3.0 248 10/7/2025
1.1.1 231 10/5/2025
1.1.0 208 10/3/2025
1.0.0 265 10/2/2025