![]() |
VOOZH | about |
dotnet add package Sextant --version 4.0.30
NuGet\Install-Package Sextant -Version 4.0.30
<PackageReference Include="Sextant" Version="4.0.30" />
<PackageVersion Include="Sextant" Version="4.0.30" />Directory.Packages.props
<PackageReference Include="Sextant" />Project file
paket add Sextant --version 4.0.30
#r "nuget: Sextant, 4.0.30"
#:package Sextant@4.0.30
#addin nuget:?package=Sextant&version=4.0.30Install as a Cake Addin
#tool nuget:?package=Sextant&version=4.0.30Install as a Cake Tool
👁 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>
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:
Install the packages into your app and platform projects, depending on target UI stack.
Minimum platform versions follow ReactiveUI platform minimums: https://reactiveui.net/docs/getting-started/minimum-versions#platform-minimums
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.
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
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();
}
}
Sextant provides two main services:
Common methods (both services)
Parameter navigation (IParameterViewStackService)
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();
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);
}
This repository contains MAUI and Avalonia samples demonstrating full setups (registration, navigation, parameters, and modal flows). Explore the Samples folder in the repo.
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. |
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. |
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 |