Sextant 4.0.30

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

Sextant

NuGet Stats Build Code Coverage alternate text is missing from this package README image alternate text is missing from this package README image

<p align="left"><img src="https://github.com/reactiveui/styleguide/blob/master/logo_sextant/vertical.png?raw=true" alt="Sextant" height="180px"></p>

A ReactiveUI view model based navigation library

Sextant provides a simple, reactive, view model first navigation service for ReactiveUI applications. It originated from ideas in Kent Boogaart's “Custom routing in ReactiveUI” and has evolved to support modern platforms and the latest ReactiveUI/Splat patterns.

Sextant focuses on:

  • ViewModel-first navigation with reactive APIs (IObservable<Unit>)
  • Lifecycle hooks for parameterized navigation (INavigable)
  • Uniform abstractions across platforms with pluggable IView/IViewLocator

Packages

Install the packages into your app and platform projects, depending on target UI stack.

  • Core (required): Sextant
  • .NET MAUI: Sextant.Maui (NavigationView + DI helpers)
  • Avalonia: Sextant.Avalonia (NavigationView + DI helpers)
  • Optional: Sextant.Plugins.Popup (MAUI, Mopups based modal plugin)

Minimum platform versions follow ReactiveUI platform minimums: https://reactiveui.net/docs/getting-started/minimum-versions#platform-minimums

Bootstrapping with AppLocator (and AppBuilder)

ReactiveUI/Splat provide AppLocator (and AppBuilder) to configure dependency resolution for your app. Sextant integrates with AppLocator and auto-initializes when the resolver is ready.

At app startup, register your navigation view, view models, and view locator, then push the initial page.

.NET MAUI quick start

  • Ensure you’ve added ReactiveUI.Maui and Sextant.Maui.
  • Register views and services using AppLocator.
  • Set MainPage to the registered NavigationView.

Example (in App constructor or after DI setup):

using ReactiveUI;
using ReactiveUI.Maui;
using Sextant;
using Sextant.Maui;
using Splat;

// Register all navigation components
AppLocator.CurrentMutable
    // IViewLocator should be registered in your app; many apps use ReactiveUI.ViewLocator.Current
    .RegisterConstant(ReactiveUI.ViewLocator.Current, typeof(IViewLocator))
    .RegisterNavigationView() // Sextant.Maui NavigationView
    .RegisterViewModelFactory(() => new DefaultViewModelFactory())
    .RegisterParameterViewStackService()
    // Views and VMs for navigation
    .RegisterViewForNavigation<HomeView, HomeViewModel>(() => new HomeView(), () => new HomeViewModel())
    .RegisterViewForNavigation<DetailsView, DetailsViewModel>(() => new DetailsView(), () => new DetailsViewModel());

// Push initial page
AppLocator.Current
    .GetService<IParameterViewStackService>()
    .PushPage<HomeViewModel>(resetStack: true, animate: false)
    .Subscribe();

// Hook MAUI MainPage to Sextant NavigationView
MainPage = AppLocator.Current.GetNavigationView();

Notes

  • If you don’t pass parameters, IViewStackService is sufficient. If you pass parameters or use INavigable lifecycle, prefer IParameterViewStackService.
  • Sextant.Maui exposes GetNavigationView() to fetch the registered NavigationView.

Avalonia quick start

Register navigation and show a window containing the NavigationView.

using Avalonia;
using Avalonia.Controls;
using ReactiveUI;
using Sextant;
using Sextant.Avalonia;
using Splat;

public static class Program
{
    [STAThread]
    public static void Main(string[] args)
    {
        BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
    }

    public static AppBuilder BuildAvaloniaApp()
        => AppBuilder.Configure<App>()
            .UsePlatformDetect()
            .UseReactiveUI();
}

public class App : Application
{
    public override void OnFrameworkInitializationCompleted()
    {
        // DI registrations
        AppLocator.CurrentMutable
            .RegisterConstant(ReactiveUI.ViewLocator.Current, typeof(IViewLocator))
            .RegisterNavigationView(() => new Sextant.Avalonia.NavigationView())
            .RegisterViewModelFactory(() => new DefaultViewModelFactory())
            .RegisterViewForNavigation<HomeView, HomeViewModel>(() => new HomeView(), () => new HomeViewModel());

        var viewStack = AppLocator.Current.GetService<IViewStackService>()!;
        viewStack.PushPage<HomeViewModel>(resetStack: true).Subscribe();

        if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
        {
            desktop.MainWindow = new Window { Content = AppLocator.Current.GetNavigationView() };
        }

        base.OnFrameworkInitializationCompleted();
    }
}

Using the navigation services

Sextant provides two main services:

  • IViewStackService – view model first navigation
  • IParameterViewStackService – navigation with parameters and lifecycle

Common methods (both services)

  • IObservable<Unit> PushPage<TViewModel>(string? contract = null, bool resetStack = false, bool animate = true)
  • IObservable<Unit> PushPage(IViewModel viewModel, string? contract = null, bool resetStack = false, bool animate = true)
  • IObservable<Unit> PushModal<TViewModel>(string? contract = null, bool withNavigationPage = true)
  • IObservable<Unit> PushModal(IViewModel modal, string? contract = null, bool withNavigationPage = true)
  • IObservable<Unit> PopPage(bool animate = true)
  • IObservable<Unit> PopModal(bool animate = true)
  • IObservable<Unit> PopToRootPage(bool animate = true)
  • IObservable<IImmutableList<IViewModel>> PageStack / ModalStack
  • IObservable<IViewModel> TopPage() / TopModal()

Parameter navigation (IParameterViewStackService)

  • IObservable<Unit> PushPage<TViewModel>(INavigationParameter parameter, string? contract = null, bool resetStack = false, bool animate = true) where TViewModel : INavigable
  • IObservable<Unit> PushPage(INavigable vm, INavigationParameter parameter, string? contract = null, bool resetStack = false, bool animate = true)
  • IObservable<Unit> PushModal<TViewModel>(INavigationParameter parameter, string? contract = null, bool withNavigationPage = true) where TViewModel : INavigable
  • IObservable<Unit> PushModal(INavigable modal, INavigationParameter parameter, string? contract = null, bool withNavigationPage = true)
  • IObservable<Unit> PopPage(INavigationParameter parameter, bool animate = true)

Parameters and lifecycle (INavigable)

Implement INavigable on your view models to receive lifecycle notifications and parameters.

using System;
using System.Reactive;
using Sextant;

public sealed class DetailsViewModel : INavigable
{
    public string Id => nameof(DetailsViewModel);

    public IObservable<Unit> WhenNavigatingTo(INavigationParameter parameter)
    {
        // Called before the page is pushed
        return Observable.Return(Unit.Default);
    }

    public IObservable<Unit> WhenNavigatedTo(INavigationParameter parameter)
    {
        // Read parameters
        parameter.TryGetValue("itemId", out string id);
        return Observable.Return(Unit.Default);
    }

    public IObservable<Unit> WhenNavigatedFrom(INavigationParameter parameter)
        => Observable.Return(Unit.Default);
}

Passing parameters

var param = new NavigationParameter { ["itemId"] = someId };
_appLocator.GetService<IParameterViewStackService>()
    .PushPage<DetailsViewModel>(param)
    .Subscribe();

View model usage example

using System.Reactive;
using ReactiveUI;
using Sextant;

public class HomeViewModel : ViewModelBase
{
    public HomeViewModel(IViewStackService nav)
    {
        OpenDetails = ReactiveCommand.CreateFromObservable(
            () => nav.PushPage<DetailsViewModel>(),
            outputScheduler: RxSchedulers.MainThreadScheduler);

        OpenModal = ReactiveCommand.CreateFromObservable(
            () => nav.PushModal<AboutViewModel>(),
            outputScheduler: RxSchedulers.MainThreadScheduler);

        Back = ReactiveCommand.CreateFromObservable(
            () => nav.PopPage(),
            outputScheduler: RxSchedulers.MainThreadScheduler);
    }

    public ReactiveCommand<Unit, Unit> OpenDetails { get; }
    public ReactiveCommand<Unit, Unit> OpenModal { get; }
    public ReactiveCommand<Unit, Unit> Back { get; }

    public override string Id => nameof(HomeViewModel);
}

Contracts and modal options

  • contract lets you register/resolve alternate views for the same ViewModel.
  • withNavigationPage (PushModal) wraps the modal in a navigation page on platforms that support it (e.g., MAUI).
  • resetStack replaces the navigation stack with the pushed page.

Best practices

  • Register IViewLocator. If you already use ReactiveUI’s default, register ReactiveUI.ViewLocator.Current as IViewLocator.
  • Use AppLocator.CurrentMutable to register views, services, and factories during boot.
  • Prefer IParameterViewStackService when passing data or using lifecycle hooks (INavigable).
  • Dispose resources in view models implementing IDestructible; Sextant calls Destroy() when a VM is popped.
  • Observe on RxApp.MainThreadScheduler when updating UI; Sextant uses IView.MainThreadScheduler internally.

Samples

This repository contains MAUI and Avalonia samples demonstrating full setups (registration, navigation, parameters, and modal flows). Explore the Samples folder in the repo.

Contribute

Sextant is developed under an OSI-approved open source license, making it freely usable and distributable, even for commercial use. We appreciate contributions of all kinds: docs, samples, bug reports, and features.

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 is compatible.  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 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. 
.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.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on Sextant:

Package Downloads
Sextant.XamForms

A ReactiveUI navigation library for Xamarin.Forms

Sextant.Maui

A ReactiveUI navigation library for Xamarin.Forms

Sextant.Avalonia

A ReactiveUI navigation library for Xamarin.Forms

Community.Sextant.WinUI

A ReactiveUI navigation library for WinUI 3.

Community.Sextant.WinUI.Microsoft.Extensions.DependencyInjection

An adapter for Microsoft.Extensions.DependencyInjection for Community.Sextant.WinUI.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.30 279 12/7/2025
3.0.1 7,347 5/27/2024
2.12.162 408 5/26/2024
2.12.120 2,935 1/25/2024
2.12.113 1,111 12/9/2023
2.12.112 413 12/9/2023
2.12.4 14,369 5/19/2021
2.12.3 710 5/18/2021
2.11.1 12,903 2/28/2021
2.10.1 7,927 1/22/2021
2.9.5 997 12/31/2020
2.9.4 858 12/28/2020
2.9.1 3,288 12/16/2020
2.8.1 1,341 11/5/2020
2.7.1 3,481 6/6/2020
2.6.1 1,056 5/8/2020
2.5.8 1,402 3/5/2020
2.5.1 1,488 1/6/2020
2.4.1 1,184 12/12/2019
2.3.9 964 12/5/2019
2.3.7 869 11/28/2019
2.3.1 891 11/21/2019
2.2.2 3,783 9/16/2019
2.2.1 919 9/6/2019
2.1.1 1,075 8/28/2019
2.0.6 947 8/24/2019
2.0.1 1,503 7/26/2019
1.5.5 1,461 3/20/2019
1.4.0 1,619 8/16/2018
1.4.0-unstable0003 941 8/16/2018
1.4.0-unstable0002 965 8/16/2018
1.3.0 3,508 7/20/2018
1.1.0-unstable0007 1,870 6/7/2018
1.1.0-unstable0006 1,428 6/7/2018
1.1.0-unstable0005 1,347 6/7/2018
1.1.0-unstable0004 1,328 6/6/2018
1.1.0-unstable0001 1,323 6/1/2018
0.4.0-unstable0004 1,411 6/1/2018
0.4.0-unstable0003 1,436 5/21/2018
0.4.0-unstable0002 1,385 4/16/2018
0.4.0-unstable0001 1,334 4/16/2018
0.3.4 1,618 4/16/2018
0.3.0-unstable0018 1,374 4/16/2018