$ show MahApps/MahApps.Metro.IconPacks
This repository provides 40+ icon pack libraries for WPF (and UWP) applications under the MahApps.Metro ecosystem. The core architecture defines base classes (PackIconControlBase, PackIconDataFactory, converters) that each icon pack extends with auto-generated code: an enum of icon identifiers (e.g., PackIconFontAwesome6Kind), a PackIcon control, markup extensions, and converters. Icon path data is embedded as JSON resources and loaded via a singleton factory. The code is predominantly auto-generated from upstream icon sets (Font Awesome, Material Design, Bootstrap, etc.), leading to a highly repetitive structure across packs. The library is actively maintained with recent commits, CI/CD pipelines, and semantic versioning. While the code is well-organized and functional, the heavy reliance on code generation reduces craftsmanship in the per-pack files; the genuinely reusable components are the base classes in the Core project, which implement icon scaling, flip, rotation, spin animation, and data loading patterns.
The LLM identified 4 files worth highlighting for reuse:
Implements a generic singleton factory that loads icon path data from embedded JSON resources (Icons.json) at runtime. Provides a dictionary mapping icon enum values to SVG path data strings. Demonstrates a clean pattern for embedding and serving per-icon-pack geometry data, reusable across any XAML icon library.
Abstract base class for all WPF icon controls. Defines common dependency properties (Kind, Flip, RotationAngle, Spin), manages path data updates, and implements spin animation via Storyboard. Provides SetKind<TKind>() and UpdateData() pattern that derived classes override. This is the core reusable pattern for building any vector icon control in WPF.
A simple IValueConverter (also a MarkupExtension) that converts a FlipOrientation enum to a ScaleX value (1 or -1) for horizontally flipping an icon. Demonstrates a clean, testable converter pattern that can be extracted for any flip/scale transformation requirement in XAML.
Provides a helper to read embedded text resources from the calling assembly. Used by the data factory to load Icons.json. Encapsulates the ResourceManager-based reading logic, making it easy to load any embedded text file from the same assembly without manual stream handling.