No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Marcel van der Heide db586acbc7
All checks were successful
Build Avalon.Views.Navigation / build (push) Successful in 26s
Build and push Avalon.Views.Navigation / build (push) Successful in 46s
feat: improve workflow
2026-08-14 18:46:05 +02:00
.forgejo/workflows feat: improve workflow 2026-08-14 18:46:05 +02:00
Avalon.Views.Navigation feat: allow version range for deps 2026-08-14 17:52:02 +02:00
Avalon.Views.Navigation.Avalonia feat: allow version range for deps 2026-08-14 17:52:02 +02: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