Open Source · Avalonia

Generic Host, MVVM, and Material 3,
for Avalonia.

A small collection of libraries for the Avalonia UI framework — boot a desktop app on the .NET Generic Host, wire view models to views at compile time, and theme the whole thing with Material 3. For Avalonia 12. MIT licensed, on NuGet.


The project

The plumbing a real Avalonia app needs

Avalonia is a cross-platform .NET UI framework — one XAML codebase for Windows, macOS, and Linux. It gives you the controls and the runtime, but leaves the application scaffolding to you: how you boot the app, wire dependencies, locate views, and theme the surface.

CCSWE.Avalonia fills that gap with three focused libraries. They lean on patterns .NET developers already know — the Generic Host, dependency injection, MVVM — so an Avalonia app starts from familiar ground instead of hand-written plumbing. Each library stands on its own; take one or take all three.

Built for Avalonia 12. Everything is MIT licensed and published on NuGet, and the major version tracks the Avalonia major it targets.

Library collection

Three libraries for Avalonia 12.

  • CCSWE.Avalonia.Hosting NuGet downloads

    Bootstrap a desktop app on the .NET Generic Host — DI, IHostedService/ BackgroundService lifecycle, configuration, and logging, without the hand-written host wiring. DesktopApplication.CreateBuilder<App>() carries Program.Main, and your App receives the provider via IServiceProviderAccessor. Ships as a lifetime-agnostic contract plus a .Desktop host package.

  • CCSWE.Avalonia.ViewLocator NuGet downloads

    A compile-time, AOT- and trim-safe ViewLocator. A Roslyn source generator pairs each FooViewModel with its FooView by naming convention — with a [View] override and an assembly-wide fallback — and resolves the view from your IServiceProvider. No reflection, no hand-maintained type map; [GenerateViewLocator(typeof(ViewModelBase))] on a partial class is the whole locator.

  • CCSWE.Avalonia.Material NuGet downloads

    A standalone Material 3 theme — a Dark/Light color system, the M3 type scale, motion, embedded fonts, and control themes spanning the full surface: buttons, text fields, selection controls, lists, menus, tabs, sliders, progress, the date family, navigation drawer, and more. It depends only on Avalonia core and supplies the whole control surface itself — no FluentTheme base required.

Seen in production

Real apps run on these.

Remote.Adb — the cross-platform adb-over-SSH tool — is built on all three: hosted on CCSWE.Avalonia.Hosting, views resolved by CCSWE.Avalonia.ViewLocator, and themed with CCSWE.Avalonia.Material. It's the clearest demonstration of the libraries working together in a shipping application.

See Remote.Adb →
MIT License

Browse the libraries on GitHub

All three libraries are MIT licensed and available on NuGet. Each repo includes a sample app and usage docs.

View on GitHub