xaf
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseXAF (eXpressApp Framework) — Skill Index
XAF (eXpressApp Framework) — 技能索引
DevExpress XAF is a cross-platform .NET application framework for building business applications (Blazor Server and WinForms). It provides MVVM architecture, ORM integration (EF Core and XPO), security, validation, and rich module ecosystem.
Versions covered: v24.2 and v25.1
Platforms: Blazor Server, WinForms, Web API (OData)
Official docs: https://docs.devexpress.com/eXpressAppFramework/112670/expressapp-framework
DevExpress MCP: https://api.devexpress.com/mcp/docs
DevExpress XAF是一款用于构建业务应用(Blazor Server和WinForms)的跨平台.NET应用框架。它提供MVVM架构、ORM集成(EF Core和XPO)、安全、验证以及丰富的模块生态系统。
覆盖版本: v24.2和v25.1
支持平台: Blazor Server、WinForms、Web API (OData)
官方文档: https://docs.devexpress.com/eXpressAppFramework/112670/expressapp-framework
DevExpress MCP: https://api.devexpress.com/mcp/docs
Sub-Skills — When to Use Each
子技能 — 适用场景
Data Modeling
数据建模
| Skill | Load When |
|---|---|
| Defining XPO persistent objects (XPObject, BaseObject, associations, PersistentAlias) |
| Defining EF Core entities (BaseObject EF, virtual properties, DbContext, migrations) |
| Creating NonPersistent objects for custom data sources, API wrappers, input dialogs |
| 技能 | 加载时机 |
|---|---|
| 定义XPO持久化对象(XPObject、BaseObject、关联关系、PersistentAlias)时 |
| 定义EF Core实体(BaseObject EF、虚拟属性、DbContext、迁移)时 |
| 为自定义数据源、API封装、输入对话框创建非持久化对象时 |
UI Construction
UI构建
| Skill | Load When |
|---|---|
| Creating controllers, SimpleAction/PopupWindowShowAction/SingleChoiceAction/ParametrizedAction |
| Working with built-in property editors, list editors, GridListEditor customization |
| Building custom property editors (Blazor/WinForms) or custom list editors |
| Conditionally hiding/disabling/coloring UI elements via [Appearance] attribute |
| 技能 | 加载时机 |
|---|---|
| 创建控制器、SimpleAction/PopupWindowShowAction/SingleChoiceAction/ParametrizedAction时 |
| 使用内置属性编辑器、列表编辑器、GridListEditor自定义时 |
| 构建自定义属性编辑器(Blazor/WinForms)或自定义列表编辑器时 |
| 通过[Appearance]属性条件隐藏/禁用/着色UI元素时 |
Platform-Specific
平台专属功能
| Skill | Load When |
|---|---|
| Blazor-specific UI, thread safety (InvokeAsync), Razor components in XAF, JS interop |
| WinForms-specific UI, XtraGrid access, background workers, layout, splash |
| 技能 | 加载时机 |
|---|---|
| 处理Blazor专属UI、线程安全(InvokeAsync)、XAF中使用Razor组件、JS互操作时 |
| 处理WinForms专属UI、XtraGrid访问、后台工作器、布局、启动页时 |
Security & Multi-Tenancy
安全与多租户
| Skill | Load When |
|---|---|
| Roles, permissions, authentication (Standard/AD/OAuth2), programmatic permission checks |
| Multi-tenant SaaS apps with separate DB per tenant (v24.2+) |
| 技能 | 加载时机 |
|---|---|
| 配置角色、权限、身份认证(标准/AD/OAuth2)、编程式权限检查时 |
| 开发按租户隔离数据库的多租户SaaS应用(v24.2+)时 |
Services & API
服务与API
| Skill | Load When |
|---|---|
| Building/consuming XAF OData Web API (JWT, custom endpoints, $filter/$expand) |
| Validation rules (RuleRequiredField, RuleCriteria, custom rules, programmatic validation) |
| 技能 | 加载时机 |
|---|---|
| 构建/调用XAF OData Web API(JWT、自定义端点、$filter/$expand)时 |
| 配置验证规则(RuleRequiredField、RuleCriteria、自定义规则、编程式验证)时 |
Modules & Features
模块与功能
| Skill | Load When |
|---|---|
| XtraReports integration (setup, predefined reports, export, designer, parameters) |
| Dashboard analytics (setup, data sources, designer, permissions) |
| File attachments, Spreadsheet editor, RichText editor, PDF viewer |
| 技能 | 加载时机 |
|---|---|
| 集成XtraReports(配置、预定义报表、导出、设计器、参数)时 |
| 实现仪表盘分析(配置、数据源、设计器、权限)时 |
| 处理文件附件、电子表格编辑器、富文本编辑器、PDF查看器时 |
Deployment
部署
| Skill | Load When |
|---|---|
| IIS/Azure/Docker for Blazor, ClickOnce/MSI for WinForms, migrations, license, logging |
| 技能 | 加载时机 |
|---|---|
| 为Blazor部署IIS/Azure/Docker、为WinForms部署ClickOnce/MSI、处理迁移、许可证、日志时 |
Diagnostics & Quality
诊断与质量
| Skill | Load When |
|---|---|
| Diagnosing memory leaks, auditing event handler cleanup, reviewing ObjectSpace/CollectionSource lifetime |
| 技能 | 加载时机 |
|---|---|
| 诊断内存泄漏、审计事件处理器清理、检查ObjectSpace/CollectionSource生命周期时 |
Quick Architecture Reference
快速架构参考
MySolution/
├── MySolution.Module/ ← platform-agnostic (business objects, controllers, modules)
│ ├── BusinessObjects/
│ ├── Controllers/
│ └── MySolutionModule.cs
├── MySolution.Blazor.Server/ ← Blazor-specific (Program.cs, BlazorApplication.cs)
│ └── DatabaseUpdate/Updater.cs
├── MySolution.Win/ ← WinForms-specific (Program.cs, WinApplication.cs)
└── MySolution.WebApi/ ← Web API service (Program.cs, OData endpoints)MySolution/
├── MySolution.Module/ ← 平台无关(业务对象、控制器、模块)
│ ├── BusinessObjects/
│ ├── Controllers/
│ └── MySolutionModule.cs
├── MySolution.Blazor.Server/ ← Blazor专属(Program.cs、BlazorApplication.cs)
│ └── DatabaseUpdate/Updater.cs
├── MySolution.Win/ ← WinForms专属(Program.cs、WinApplication.cs)
└── MySolution.WebApi/ ← Web API服务(Program.cs、OData端点)Key Concepts
核心概念
- ObjectSpace () — unit of work; wraps EF Core DbContext or XPO Session. Not thread-safe. Never store in singleton services.
IObjectSpace - XafApplication — application lifecycle, module registration, ObjectSpace creation.
- ModuleBase — platform-agnostic module; registers business objects, controllers, navigation items.
- Application Model — XML/in-memory model describing Views, Actions, Navigation — customizable without recompilation.
- DatabaseUpdater — runs on startup to apply schema changes and seed data ().
Updater.cs
- ObjectSpace () — 工作单元;封装EF Core DbContext或XPO Session。非线程安全。切勿存储在单例服务中。
IObjectSpace - XafApplication — 应用生命周期管理、模块注册、ObjectSpace创建。
- ModuleBase — 平台无关模块;注册业务对象、控制器、导航项。
- Application Model — 描述视图、动作、导航的XML/内存模型,无需重新编译即可自定义。
- DatabaseUpdater — 应用启动时运行,用于应用 schema 变更和初始化数据()。
Updater.cs
Common Pitfalls (Quick Reference)
常见陷阱(快速参考)
| Pitfall | Fix |
|---|---|
| Use |
| Remove |
| Non-virtual EF Core properties | All EF Core entity properties must be |
XPO property without | Use backing field + |
| XAF requires |
| NonPersistent provider registered first | Register |
| 陷阱 | 修复方案 |
|---|---|
在单例服务中使用 | 使用 |
在Blazor中使用 | 移除 |
| EF Core属性非虚拟 | 所有EF Core实体属性必须声明为 |
XPO属性未使用 | 使用 backing field + |
使用 | XAF需要 |
| 非持久化提供器优先注册 | 持久化提供器注册完成后再调用 |
Useful Links
有用链接
- XAF Getting Started (Blazor): https://docs.devexpress.com/eXpressAppFramework/402189/getting-started/in-depth-tutorial-blazor
- XAF Getting Started (WinForms): https://docs.devexpress.com/eXpressAppFramework/402684/getting-started/in-depth-tutorial-winforms-webforms
- XAF API Reference: https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp
- DevExpress Examples (GitHub): https://github.com/DevExpress-Examples
- DevExpress Support: https://supportcenter.devexpress.com
- XAF Community (Blogs): https://community.devexpress.com/tags/XAF
- XAF入门指南(Blazor):https://docs.devexpress.com/eXpressAppFramework/402189/getting-started/in-depth-tutorial-blazor
- XAF入门指南(WinForms):https://docs.devexpress.com/eXpressAppFramework/402684/getting-started/in-depth-tutorial-winforms-webforms
- XAF API参考:https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp
- DevExpress示例(GitHub):https://github.com/DevExpress-Examples
- DevExpress支持中心:https://supportcenter.devexpress.com
- XAF社区(博客):https://community.devexpress.com/tags/XAF