How accntech/shad-ui works
Project Type & Purpose
• ShadUI is an open-source, Avalonia-based Desktop UI component library plus a demo application and packaging project.
• It delivers reusable controls, themes, dialogs, toasts, converters, utilities, and responsive breakpoints, all orchestrated under one solution (ShadUI.sln).
Core Components
• ShadUI Library (src/ShadUI)
• Controls (Buttons, Cards, DataGrid, etc.)
• Dialogs (DialogHost, DialogBuilder)
• Toasts (ToastBuilder, ToastHost)
• Themes (ShadTheme, Dark/Light, ThemeWatcher)
• Converters (Value converters for bindings)
• Breakpoints (Responsive layout helpers)
• Extensions & Utilities (ControlAssist, AnimationHelpers, etc.)
• Styles (AXAML resource files)
• Enums & Input (support classes)
• ShadUI.Demo (src/ShadUI.Demo)
• A desktop client app showcasing every control/feature in an MVVM pattern
• View layer: AXAML files under Views and Controls folders
• ViewModel layer: ViewModels under ViewModels folder
• Converters & Validators for demonstration
• ServiceProvider for dependency injection
• ShadUI.Package (src/ShadUI.Package)
• A UWP packaging project (.wapproj + appxmanifest) to publish a Microsoft-Store client
• CI/CD
• GitHub Actions workflow to publish the NuGet package (publish-nuget.yml)
Component Relationships & Data Flow
• ShadUI.Demo → references → ShadUI Library
• Demo ViewViews (AXAML) ←data-bind→ ViewModels ←use→ Converters & Validators
• ShadUI Library modules are self-contained: Controls consume Styles/Themes, call DialogManager/ToastManager for overlays, and use Utilities/Extensions internally.
• The Packaging project bundles the Demo as a UWP app for distribution.
• CI/CD automates building ShadUI Library and pushing the NuGet package to nuget.org.
Architectural Patterns & Principles
• Modular Design: Each functional area (Controls, Dialogs, Themes, etc.) lives in its own namespace and folder.
• MVVM (in Demo): Clean separation between Views (AXAML) and ViewModels (C#) with data-binding via Converters.
• Theming & Styling: Centralized resource dictionaries (AXAML) that plug into Avalonia’s styling system.
• Extensibility Points:
• DialogBuilderExtensions, ToastBuilderExtensions
• Breakpoint services for responsive layouts
• ControlAssist and other attached behavior classes for augmenting Avalonia controls
• Clear, consistent labels on all components.
• Library modules (rectangles with blue outline)
• Demo MVVM layers (stacked green rectangles)