VOOZH about

URL: https://www.nuget.org/packages/sextant

⇱ NuGet Gallery | Sextant 4.0.30



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
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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 Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 was computed. 
.NET Framework net461 net461 was computed.  net462 net462 was computed.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 was computed.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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 706 12/7/2025
3.0.1 8,604 5/27/2024
2.12.162 461 5/26/2024
2.12.120 2,992 1/25/2024
2.12.113 1,162 12/9/2023
2.12.112 474 12/9/2023
2.12.4 14,555 5/19/2021
2.12.3 750 5/18/2021
2.11.1 12,968 2/28/2021
2.10.1 7,965 1/22/2021
2.9.5 1,041 12/31/2020
2.9.4 905 12/28/2020
2.9.1 3,327 12/16/2020
2.8.1 1,398 11/5/2020
2.7.1 3,549 6/6/2020
2.6.1 1,098 5/8/2020
2.5.8 1,434 3/5/2020
2.5.1 1,528 1/6/2020
2.4.1 1,223 12/12/2019
2.3.9 1,007 12/5/2019
Loading failed