- 完成三层颜色架构实现(Primitives → Semantic → Component) - 新增暗色主题支持,包含完整的 Apple HIG Dark Mode 色值 - 重构颜色系统为六类别架构(Background, Foreground, Border, Accent, State, Surface) - 完善颜色演示页面,按类别分组展示所有颜色 - 更新主题切换说明,支持手动切换浅色/暗色主题 - 新增 BMad 方法文档和架构说明 - 完善 README 和技术栈文档
6.6 KiB
6.6 KiB
Unified Project Structure
基于 Monorepo 策略和 .NET 项目组织最佳实践,以下是详细的项目文件结构:
D:\32_avalonia.ui/
├── .github/ # GitHub 工作流(Post-MVP)
│ └── workflows/
│ ├── ci.yml # 持续集成
│ └── release.yml # 发布流程
│
├── src/ # 源代码目录
│ ├── Penguin.AvaloniaUI/ # 核心控件库项目
│ │ ├── Controls/ # 业务场景控件
│ │ │ ├── PropertyGrid/
│ │ │ │ ├── PropertyGrid.cs # 主控件类
│ │ │ │ ├── PropertyItem.cs # 数据模型
│ │ │ │ ├── PropertyEditorFactory.cs # 编辑器工厂
│ │ │ │ └── Themes/
│ │ │ │ ├── PropertyGrid.axaml # 默认模板
│ │ │ │ └── PropertyGrid.axaml.cs
│ │ │ ├── UserGuide/
│ │ │ │ ├── UserGuide.cs
│ │ │ │ ├── GuideStep.cs
│ │ │ │ ├── Overlay.cs
│ │ │ │ ├── RichTooltip.cs
│ │ │ │ └── Themes/
│ │ │ │ ├── UserGuide.axaml
│ │ │ │ ├── Overlay.axaml
│ │ │ │ └── RichTooltip.axaml
│ │ │ └── ... (其他控件)
│ │ │
│ │ ├── Layouts/ # 布局控件
│ │ │ ├── TwoColumnLayout.cs
│ │ │ └── Themes/
│ │ │ └── TwoColumnLayout.axaml
│ │ │
│ │ ├── Themes/ # 主题系统
│ │ │ ├── Colors/ # 三层颜色架构
│ │ │ │ ├── Primitives.axaml # 原子层:Apple 官方颜色
│ │ │ │ ├── Light.axaml # 语义层:浅色主题
│ │ │ │ └── Dark.axaml # 语义层:暗色主题
│ │ │ └── Theme.axaml # 主题入口文件
│ │ │
│ │ ├── Utils/ # 工具类
│ │ │ ├── Converters/ # 值转换器
│ │ │ │ ├── BoolToVisibilityConverter.cs
│ │ │ │ └── TypeToEditorConverter.cs
│ │ │ ├── Helpers/ # 辅助类
│ │ │ │ ├── ReflectionHelper.cs # 反射工具
│ │ │ │ └── ValidationHelper.cs # 验证工具
│ │ │ └── Extensions/ # 扩展方法
│ │ │ └── ObservableExtensions.cs
│ │ │
│ │ ├── Assets/ # 资源文件
│ │ │ └── Icons/ # 图标资源
│ │ │
│ │ ├── Penguin.AvaloniaUI.csproj # 项目文件
│ │ └── AssemblyInfo.cs # 程序集信息
│ │
│ ├── Penguin.AvaloniaUI.SourceGenerators/ # Source Generator(Post-MVP)
│ │ ├── PropertyGridGenerator.cs
│ │ └── Penguin.AvaloniaUI.SourceGenerators.csproj
│ │
│ ├── Example/ # 示例应用项目
│ │ ├── App.axaml # 应用程序资源
│ │ ├── App.axaml.cs
│ │ ├── ViewModels/ # 视图模型
│ │ │ ├── MainWindowViewModel.cs
│ │ │ ├── PropertyGridDemoViewModel.cs
│ │ │ └── UserGuideDemoViewModel.cs
│ │ ├── Views/ # 视图/页面
│ │ │ ├── MainWindow.axaml
│ │ │ ├── MainWindow.axaml.cs
│ │ │ ├── Pages/
│ │ │ │ ├── ColorSystemPage.axaml # 颜色系统演示
│ │ │ │ ├── PropertyGridPage.axaml # PropertyGrid 演示
│ │ │ │ ├── UserGuidePage.axaml # UserGuide 演示
│ │ │ │ └── ComprehensiveDemoPage.axaml # 综合演示
│ │ │ └── ...
│ │ ├── Models/ # 测试数据模型
│ │ │ ├── DemoSettings.cs # PropertyGrid 测试类
│ │ │ └── LargeSettings.cs # 50 属性测试类
│ │ ├── Assets/ # 示例应用资源
│ │ ├── Example.csproj
│ │ └── Program.cs
│ │
│ └── Penguin.AvaloniaUI.Tests/ # 单元测试项目
│ ├── Controls/
│ │ ├── PropertyGridTests.cs
│ │ ├── UserGuideTests.cs
│ │ └── ...
│ ├── Layouts/
│ │ └── TwoColumnLayoutTests.cs
│ ├── Themes/
│ │ └── ThemeManagerTests.cs
│ ├── Utils/
│ │ └── ReflectionHelperTests.cs
│ └── Penguin.AvaloniaUI.Tests.csproj
│
├── docs/ # 项目文档
│ ├── prd.md # 产品需求文档
│ ├── architecture.md # 架构文档(本文档)
│ ├── brief.md # 项目简介
│ └── brainstorm.md # 头脑风暴
│
├── .bmad-core/ # BMAD 框架配置
│ ├── core-config.yaml
│ ├── agents/
│ ├── tasks/
│ └── templates/
│
├── .editorconfig # 编辑器配置
├── .gitignore # Git 忽略规则
├── Directory.Packages.props # 统一包版本管理
├── README.md # 项目说明
├── LICENSE # 许可证(Post-MVP)
└── Penguin.AvaloniaUI.sln # 解决方案文件
关键目录说明:
| 目录 | 用途 | 命名空间 |
|---|---|---|
Controls/ |
业务场景控件实现 | Penguin.AvaloniaUI.Controls.* |
Layouts/ |
布局控件实现 | Penguin.AvaloniaUI.Layouts |
Themes/ |
主题和样式系统 | Penguin.AvaloniaUI.Themes |
Utils/ |
工具类和辅助方法 | Penguin.AvaloniaUI.Utils.* |
Example/Views/Pages/ |
示例应用页面 | Example.Views.Pages |
Example/ViewModels/ |
示例应用 ViewModel | Example.ViewModels |