Navis.WinUI 0.9.2

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

Install the NuGet package:

dotnet add package Navis.WinUI

Navis.WinUI is a compact WinUI 3 navigation library for typed, nested, and declarative page navigation.

Quick usage

Register navigation with the application's service collection. Injected INavigation is contextual: it resolves the navigation host for the currently active frame.

using Navis.WinUI.Extensions;

services.AddNavisNavigation();

Enable navigation on a Frame and optionally provide its first page. XamlType converts a XAML type name to the Type expected by Navis:

<Page
    xmlns:main="using:YourApp.Views"
    xmlns:nav="using:Navis.WinUI">
    <Frame
        nav:NavigationHost.IsEnabled="True"
        nav:NavigationHost.InitialPage="{nav:XamlType TypeName=main:HomePage}" />
</Page>

Use the contextual navigation service from a page or view model:

public sealed class HomeViewModel(INavigation navigation)
{
    public void OpenDetails() => navigation.Navigate<DetailsPage>();

    public void OpenOrder(Order order) =>
        navigation.Navigate<DetailsPage, Order>(order);
}

Navigate<TPage>() navigates without a parameter. Navigate<TPage, TParameter>(parameter) passes a strongly typed value to the destination. Both methods also accept a NavigationKind such as Replace or Reset.

Receive a typed parameter and participate in the navigation lifecycle with INavigationAware<TParameter>:

public sealed class DetailsViewModel : INavigationAware<Order>
{
    public ValueTask OnNavigatedToAsync(
        Order order,
        CancellationToken cancellationToken)
    {
        // Load the order.
        return ValueTask.CompletedTask;
    }

    public ValueTask OnNavigatedFromAsync(CancellationToken cancellationToken) =>
        ValueTask.CompletedTask;
}

XAML navigation

Attach navigation to a button or other button-based control. Navigate.To selects the page, Navigate.Kind selects the journal operation, and Navigate.Target selects the current, parent, or root navigation host:

<Button
    xmlns:pages="using:YourApp.Views"
    xmlns:nav="using:Navis.WinUI"
    Content="Open details"
    nav:Navigate.To="{nav:XamlType TypeName=pages:DetailsPage}"
    nav:Navigate.Kind="Navigate"
    nav:Navigate.Target="Current" />

Parameters can be bound in XAML with Navigate.Parameter:

<Button
    nav:Navigate.Parameter="{x:Bind ViewModel.SelectedOrder}"
    nav:Navigate.To="{nav:XamlType TypeName=pages:DetailsPage}" />

Caveats

  • INavigation is contextual. Resolve or inject it where the intended frame is active; it is not a global navigation service.
  • Navigation must run on the frame's UI thread.
  • Requests made while another navigation request is in flight are ignored.
  • Typed parameters must match the destination's INavigationAware<TParameter> type at runtime.
  • Navigate.Target="Parent" requires a nested navigation host with a parent frame. Root resolves the top-level host, so parent/root routing requires the corresponding nested-frame structure.
Product Compatible and additional computed target framework versions.
.NET net10.0-windows10.0.19041 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.2 76 9/14/2026