$ show lepoco/wpfui
This repository is a comprehensive WPF UI library (WPF-UI) that implements Microsoft's Fluent Design System for Windows Presentation Foundation. It provides over 70 custom controls (NavigationView, ContentDialog, Snackbar, TitleBar, NumberBox, ToggleSwitch, etc.), a full theme management system with dynamic light/dark/high-contrast switching, Win32 interop for modern window chrome and taskbar integration, and a navigation framework with DI support. The library is distributed via NuGet and includes Visual Studio project templates. The codebase is well-structured with a folder-per-control pattern, partial classes for separation of concerns, and extensive use of dependency properties, routed events, and attached behaviors. The core library targets .NET 10/9/8 and .NET Framework 4.6.2–4.8.1, with abstractions targeting .NET Standard 2.0/2.1 for maximum compatibility. The repository also contains a comprehensive demo application (Wpf.Ui.Gallery) that showcases all controls with MVVM (CommunityToolkit.Mvvm), localization, and an embedded Monaco Editor for live code samples. Integration tests using FlaUI and unit tests for animations and symbol extensions are present. The architecture is documented with C4 diagrams and ADRs. The library is actively maintained with frequent commits, CI/CD via GitHub Actions, and responsive issue triage. While the codebase is generally high-quality, there are some work-in-progress controls (TreeGrid), deprecated APIs in ContentDialog, and vendored third-party assets (Monaco Editor) that introduce minor maintenance risks. Overall, this is a strong, production-ready UI library with clean abstractions and several reusable patterns.
The LLM identified 5 files worth highlighting for reuse:
Implements a robust modal dialog isolation pattern: disables sibling elements, suppresses window-level input bindings (AccessKeyManager, CommandManager), stores and restores focus, and blocks user interaction outside the dialog host. This is a clean, side-effect-free approach that can be extracted and reused in any WPF application requiring custom modal dialogs with proper focus trapping.
A high-performance virtualizing panel that supports wrapping, grouping, and custom scroll deltas. Implements IScrollInfo and provides extendable measurement, item range calculation, and recycling. The abstraction (VirtualizingPanelBase) separates common virtualization logic from layout-specific behavior, making it reusable for custom virtual panels. Demonstrates advanced WPF layout and virtualization techniques.
Monitors Windows system theme changes via Win32 messages (WM_DWMCOLORIZATIONCOLORCHANGED, WM_THEMECHANGED, etc.) and dynamically updates the application theme. Handles registry-based theme detection and per-window background management. This is a self-contained component that can be reused in any WPF application needing real-time system theme synchronization without external dependencies.
Provides static methods for HSL/HSV color space conversions, brightness/luminance modification, and accent color generation. Used by ApplicationAccentColorManager but is completely self-contained with no internal dependencies. Can be extracted and reused in any .NET project for color manipulation, demonstrating clean utility class design.
A type-safe implementation of IRelayCommand<T> with parameter validation, weak event pattern, and optional async support. Unlike many boilerplate RelayCommand implementations, this one includes proper CanExecute change notification, exception handling, and thread safety. It is a standalone component that can be reused in any MVVM application without additional dependencies.