No description
This repository has been archived on 2026-02-13. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
Dutch e51ec91ea7
All checks were successful
Build ViewHelper / build (push) Successful in 1m20s
README.md aktualisiert
2026-01-08 22:06:36 +01:00
.forgejo/workflows feat: add workflow 2025-12-24 00:18:46 +01:00
Demo feat(#5): pass arguments on navigation (#7) 2026-01-06 13:49:48 +01:00
ViewHelper feat(#5): pass arguments on navigation (#7) 2026-01-06 13:49:48 +01:00
ViewHelper.Avalonia feat(#5): pass arguments on navigation (#7) 2026-01-06 13:49:48 +01:00
.gitignore initial commit 2025-12-19 21:56:22 +01:00
LICENSE feat: add (very) basic README and LICENSE 2025-12-26 20:23:18 +01:00
README.md README.md aktualisiert 2026-01-08 22:06:36 +01:00
renovate.json chore: add renovate 2025-12-20 23:54:57 +01:00
ViewHelper.sln initial commit 2025-12-19 21:56:22 +01:00
ViewHelper.sln.DotSettings initial commit 2025-12-19 21:56:22 +01:00

NOTE

Content of this repo will be split in multiple repos -> See Avalon repos.

ViewHelper

This library provides simple implementations for view locating and animated navigation within AvaloniaUI applications.

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)

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