No description
Find a file
Renovate Bot 71ecc51590
All checks were successful
Build Avalon.Views.Navigation / build (pull_request) Successful in 1m57s
Build Avalon.Views.Navigation / build (push) Successful in 2m57s
chore(deps): update dependency avalon.views.core to 0.2.0
2026-03-09 21:59:31 +00:00
.forgejo/workflows fix: generate NuGet for both packages 2026-02-13 21:32:19 +01:00
Avalon.Views.Navigation chore(deps): update dependency avalon.views.core to 0.2.0 2026-03-09 21:59:31 +00:00
Avalon.Views.Navigation.Avalonia Initial commit 2026-02-13 21:00:33 +01:00
.gitignore Initial commit 2026-02-13 21:00:33 +01:00
Avalon.Views.Navigation.sln Initial commit 2026-02-13 21:00:33 +01:00
LICENSE Initial commit 2026-02-13 21:00:33 +01:00
nuget.config Initial commit 2026-02-13 21:00:33 +01:00
README.md Initial commit 2026-02-13 21:00:33 +01:00
renovate.json feat: add renovate 2026-02-13 21:19:51 +01:00

Avalon

Avalon provides reusable features and components to kickstart crossplatform applications with AvaloniaUI and MAUI (later on).

Library Decription AvaloniaUI MAUI
Avalon.Core Core library with basic cross-framework implementations and abstractions.
Avalon.Views.Core Core library containing basic view related implementations and abstractions.
Avalon.Views.Navigation Simple navigation service.
Avalon.Views.PopUp (planned) Simple popup service.
Avalon.Views.Controls (planned) Reusable pages and controls.

Note: MAUI support is planned, but currenly not scheduled.

Note: Always use the .Avalonia or .MAUI packages.

Avalon.Views.Navigation

This library provides implementations for view locating and animated navigation.

Features

ViewLocator

// Create the ViewLocator - a service locator may be passed optionally
var locator = new AvaloniaViewLocator();

// Resolve view
var view = locator.ResolveView<MainView, MainViewModel>()

Navigation

// Usage within another ViewModel:

// Push the resolved view 
Navigation.PushAsync(view)
    
// Resolve a view and push simultaniuisly
Navigation.PushAsync<MyView, MyViewModel>()

Available methods

  • PushAsync
  • PopAsync
  • PopToRootAsync
  • SetRootAsync

Passing data on navigation

To pass data to another object when navigating, pass an instance of NavigationData (or custom implementation of INavigationData) to one of the available navigation methods. The target object must either implement the INavigable or the IElementWithVm interface.

Initialization

Ensure that .UseViewHelper() is invoked as part of your AppBuilder initialization to activate the librarys functionality.

public static AppBuilder BuildAvaloniaApp()
    => AppBuilder.Configure<App>()
        .UsePlatformDetect()
        .UseViewHelper() // <- Add this line
        .WithInterFont()
        .LogToTrace();

License

MIT