Repository navigation
feat: ShellIcons.Avalonia preview and a shared XAML generator - #7
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Avalonia target (preview, not published)
ShellIcons.Avaloniapackage (net8.0, Avalonia 12.1): typed controls (<icons:ChevronRight />), anIcondispatcher (<icons:Icon Kind="Search" />) and the sameIconName/IconCatalog/IconInfoAPI as the MAUI package. xmlnshttps://shellicons.dev/avalonia.StreamGeometry.Foregroundis the inherited text foreground, so an icon in aButtontakes the button's color, likecurrentColorin the browser.Kind, notName: Avalonia'sNameis the element name, so the dispatcher property isKind.Titlesets 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
ShellIcons.Generator.Xamlnow 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.IconCatalogis generated:IconCatalogandIconInfoare now generated for both targets, replacing MAUI's hand-writtenIconCatalog.cs. The API is unchanged.SHELLICONS006warns whenShellIconsTargetis missing.Docs
CI
ShellIcons.slnx, which needs no workloads, andci.ymlsmoke-packsShellIcons.Avalonia.Breaking changes
None for published packages. In the unpublished MAUI preview,
IconCatalogis no longer apartialclass.Test plan
ShellIcons.slnxbuilds with 0 warnings; 134 tests pass (57 generator, 44 Blazor, 33 Avalonia)ShellIcons.Maui.slnxbuilds all 5 targets with 0 warnings; 34 MAUI tests passdotnet packofShellIcons.Avaloniaproduces a clean package (icon, readme, no analyzer dependency)shelldocs buildsucceedsFollow-ups
0.2.0-alpha: bump<Version>, decide whether to publishShellIcons.Avalonia(add it torelease.yml; it packs on ubuntu)