Skip to content

feat: ShellIcons.Avalonia preview and a shared XAML generator - #7

Merged
Shewart merged 4 commits into
mainfrom
feat/shellicons-avalonia
Oct 17, 2026
Merged

Shewart merged 4 commits into
mainfrom
feat/shellicons-avalonia

Conversation

@Shewart

@Shewart Shewart commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Avalonia target (preview, not published)

  • New ShellIcons.Avalonia package (net8.0, Avalonia 12.1): typed controls (<icons:ChevronRight />), an Icon dispatcher (<icons:Icon Kind="Search" />) and the same IconName / IconCatalog / IconInfo API as the MAUI package. xmlns https://shellicons.dev/avalonia.
  • Drawn directly: each icon is one custom-drawn control. The path data is converted at build time and parsed once per icon into a cached StreamGeometry.
  • Colored like text: Foreground is the inherited text foreground, so an icon in a Button takes the button's color, like currentColor in the browser.
  • Kind, not Name: Avalonia's Name is the element name, so the dispatcher property is Kind.
  • Accessibility: Title sets the automation name and exposes the icon as an image; without it the icon is hidden from screen readers.

One generator for MAUI and Avalonia

  • Target picked per project: ShellIcons.Generator.Xaml now has one catalog reader and one emitter. The consuming project picks its target with <ShellIconsTarget>Maui|Avalonia</ShellIconsTarget>; before this it emitted MAUI code into any project that referenced it.
  • IconCatalog is generated: IconCatalog and IconInfo are now generated for both targets, replacing MAUI's hand-written IconCatalog.cs. The API is unchanged.
  • New diagnostic: SHELLICONS006 warns when ShellIconsTarget is missing.

Docs

  • Avalonia section on the docs site (getting started, names and catalog), plus updates to the README, CHANGELOG, RELEASING and the custom-icon contract.
  • ShellDocs 0.1.11-alpha for the docs site (was 0.1.7). No code changes were needed; outdated workaround comments were trimmed.

CI

  • Avalonia in the main solution: the Avalonia projects are in ShellIcons.slnx, which needs no workloads, and ci.yml smoke-packs ShellIcons.Avalonia.

Breaking changes

None for published packages. In the unpublished MAUI preview, IconCatalog is no longer a partial class.

Test plan

  • ShellIcons.slnx builds with 0 warnings; 134 tests pass (57 generator, 44 Blazor, 33 Avalonia)
  • ShellIcons.Maui.slnx builds all 5 targets with 0 warnings; 34 MAUI tests pass
  • Each commit builds on its own
  • Avalonia tests render through Skia headless: every icon parses, stays on the 24×24 grid and draws inside its own cell; size, stroke, color, XAML namespace and accessibility checked
  • Rendered contact sheet and full-catalog image reviewed by eye
  • dotnet pack of ShellIcons.Avalonia produces a clean package (icon, readme, no analyzer dependency)
  • All 17 docs pages render on ShellDocs 0.1.11; theme toggle, Preview/Code tabs and icon search work; shelldocs build succeeds
  • Avalonia tests pass on the ubuntu CI runner (only run on Windows so far)
  • Avalonia checked in a real desktop app

Follow-ups

  • Release 0.2.0-alpha: bump <Version>, decide whether to publish ShellIcons.Avalonia (add it to release.yml; it packs on ubuntu)
  • Per-package readmes before publishing MAUI or Avalonia
  • Update the Lucide catalog (pinned at 0.475.0; Lucide is at 1.59.0)
  • Retire the GitHub Pages docs workflow; the site now runs as a container

ShellIcons.Generator.Xaml now has one catalog reader (XamlCatalog) and one emitter (CatalogEmitter). The consuming project picks its target with <ShellIconsTarget>Maui|Avalonia</ShellIconsTarget>; before, the generator emitted MAUI code into any project that referenced it. SHELLICONS006 warns when the property is missing.

IconCatalog and IconInfo are generated for every target, replacing MAUI's hand-written IconCatalog.cs. The API is unchanged.
Avalonia 12 (net8.0) target from the same catalog: a custom-drawn IconView, an Icon dispatcher with Kind (Avalonia's Name is the element name), typed controls in ShellIcons.Avalonia.Icons, inherited Foreground, and the generated IconName/IconCatalog API. xmlns https://shellicons.dev/avalonia.

Headless tests render through Skia, including every icon in the catalog. The projects join ShellIcons.slnx (no workloads needed) and CI smoke-packs the package.
Avalonia section on the docs site (getting started, names and catalog), README, CHANGELOG and RELEASING updates, and the custom-icon contract now covers both XAML targets.
No code changes were needed. Trims comments describing 0.1.7 limits that later releases fixed.
@Shewart
Shewart merged commit 6adcca6 into main Oct 17, 2026
2 checks passed
@Shewart
Shewart deleted the feat/shellicons-avalonia branch October 17, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant