dotnet-ui-chooser
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesedotnet-ui-chooser
dotnet-ui-chooser
UI framework selection decision tree for .NET applications. Covers Web (Blazor Server, Blazor WebAssembly, Blazor Hybrid), cross-platform (MAUI, Uno Platform, Avalonia), and Windows-only (WinUI 3, WPF, WinForms) frameworks. Presents structured trade-off analysis across five decision factors to help teams evaluate options based on their specific constraints.
.NET应用的UI框架选择决策树。涵盖Web(Blazor Server、Blazor WebAssembly、Blazor Hybrid)、跨平台(MAUI、Uno Platform、Avalonia)以及仅Windows平台(WinUI 3、WPF、WinForms)的框架。从五个决策维度进行结构化的权衡分析,帮助团队根据自身特定约束条件评估可选方案。
Scope
适用范围
- Framework selection decision tree (target platforms, team skills, performance, ecosystem)
- Cross-framework comparison tables
- Trade-off analysis for Web, cross-platform, and Windows-only frameworks
- 框架选择决策树(目标平台、团队技能、性能、生态系统)
- 跨框架对比表格
- Web、跨平台及仅Windows平台框架的权衡分析
Out of scope
不适用范围
- Framework-specific implementation patterns -- see individual skills listed below
- Migration paths between frameworks -- see [skill:dotnet-wpf-migration]
- Desktop UI testing -- see [skill:dotnet-ui-testing-core]
Cross-references: [skill:dotnet-blazor-patterns] for Blazor hosting and render modes, [skill:dotnet-maui-development] for MAUI patterns, [skill:dotnet-uno-platform] for Uno Platform patterns, [skill:dotnet-winui] for WinUI 3 patterns, [skill:dotnet-wpf-modern] for modern WPF on .NET 8+, [skill:dotnet-winforms-basics] for WinForms modernization.
- 框架特定的实现模式——请参考下方列出的相关skill
- 框架间的迁移路径——请参考[skill:dotnet-wpf-migration]
- 桌面UI测试——请参考[skill:dotnet-ui-testing-core]
交叉引用:Blazor托管模式和渲染模式请参考[skill:dotnet-blazor-patterns],MAUI模式请参考[skill:dotnet-maui-development],Uno Platform模式请参考[skill:dotnet-uno-platform],WinUI 3模式请参考[skill:dotnet-winui],.NET 8+上的现代WPF请参考[skill:dotnet-wpf-modern],WinForms现代化请参考[skill:dotnet-winforms-basics]。
Decision Tree
决策树
Use this structured flow to narrow framework choices based on project constraints. Each branch presents trade-offs rather than definitive answers -- the right choice depends on the weight your team assigns to each factor.
根据项目约束条件,使用此结构化流程缩小框架选择范围。每个分支仅呈现权衡关系而非绝对答案——合适的选择取决于团队对各因素的权重分配。
Step 1: Target Platforms
步骤1:目标平台
The most significant constraint. Identify which platforms the application must support.
Target platforms?
|
+-- Web browser only
| --> Blazor (Server, WebAssembly, or Auto)
| See "Blazor Hosting Model Selection" below
|
+-- Windows only
| --> WinUI 3, WPF, or WinForms
| See "Windows Framework Selection" below
|
+-- Mobile (iOS / Android)
| +-- Also need desktop?
| | +-- Yes --> MAUI or Uno Platform
| | +-- No --> MAUI or Uno Platform
| |
| +-- Also need web?
| +-- Yes --> Uno Platform (WASM target) or Blazor Hybrid in MAUI
| +-- No --> MAUI or Uno Platform
|
+-- All platforms (web + mobile + desktop)
| --> Uno Platform (broadest reach)
| or Blazor Hybrid in MAUI (web UI, native shell)
|
+-- Desktop cross-platform (Windows + macOS + Linux)
--> Uno Platform or Avalonia
MAUI supports macOS/Windows but not Linux这是最关键的约束条件。确定应用必须支持的平台。
Target platforms?
|
+-- Web browser only
| --> Blazor (Server, WebAssembly, or Auto)
| See "Blazor Hosting Model Selection" below
|
+-- Windows only
| --> WinUI 3, WPF, or WinForms
| See "Windows Framework Selection" below
|
+-- Mobile (iOS / Android)
| +-- Also need desktop?
| | +-- Yes --> MAUI or Uno Platform
| | +-- No --> MAUI or Uno Platform
| |
| +-- Also need web?
| +-- Yes --> Uno Platform (WASM target) or Blazor Hybrid in MAUI
| +-- No --> MAUI or Uno Platform
|
+-- All platforms (web + mobile + desktop)
| --> Uno Platform (broadest reach)
| or Blazor Hybrid in MAUI (web UI, native shell)
|
+-- Desktop cross-platform (Windows + macOS + Linux)
--> Uno Platform or Avalonia
MAUI supports macOS/Windows but not LinuxStep 2: Team Expertise
步骤2:团队专业技能
Match frameworks to existing team skills to reduce ramp-up time.
| Team Strength | Strong Fit | Moderate Fit | Steeper Curve |
|---|---|---|---|
| WPF / WinUI XAML | WPF, WinUI 3 | Uno Platform (WinUI XAML surface) | Blazor (Razor syntax) |
| Web (HTML/CSS/JS) | Blazor | Uno Platform (WASM target) | WPF, WinUI (XAML) |
| Xamarin.Forms | MAUI (direct successor) | Uno Platform | Blazor, WPF |
| C# but no UI framework | WinForms (simplest), Blazor | MAUI | WPF, WinUI (XAML learning curve) |
| React / Angular | Blazor WebAssembly (SPA model) | Uno Platform (WASM) | WPF, WinUI |
匹配框架与团队现有技能,以减少学习时间。
| 团队优势 | 强适配 | 中等适配 | 学习曲线陡峭 |
|---|---|---|---|
| WPF / WinUI XAML | WPF, WinUI 3 | Uno Platform (WinUI XAML surface) | Blazor (Razor syntax) |
| Web (HTML/CSS/JS) | Blazor | Uno Platform (WASM target) | WPF, WinUI (XAML) |
| Xamarin.Forms | MAUI (direct successor) | Uno Platform | Blazor, WPF |
| C# but no UI framework | WinForms (simplest), Blazor | MAUI | WPF, WinUI (XAML learning curve) |
| React / Angular | Blazor WebAssembly (SPA model) | Uno Platform (WASM) | WPF, WinUI |
Step 3: UI Complexity
步骤3:UI复杂度
Match the UI requirements to framework rendering capabilities.
| UI Need | Best Fit | Also Consider |
|---|---|---|
| Rich native Windows UI (custom controls, animations) | WinUI 3, WPF | Uno Platform (WinUI surface) |
| Web-style layouts (responsive, CSS-based) | Blazor | Uno Platform (Skia rendering) |
| Simple data-entry forms, internal tools | WinForms | Blazor (Static SSR), WPF |
| Pixel-perfect cross-platform UI | Uno Platform (Skia rendering) | Avalonia |
| Platform-native look per OS | MAUI (native controls) | Uno Platform (native mode) |
| Embedded web content in desktop/mobile app | Blazor Hybrid in MAUI | Blazor Hybrid in WPF/WinForms |
匹配UI需求与框架渲染能力。
| UI需求 | 最佳适配 | 其他可选 |
|---|---|---|
| 丰富的原生Windows UI(自定义控件、动画) | WinUI 3, WPF | Uno Platform (WinUI surface) |
| Web风格布局(响应式、基于CSS) | Blazor | Uno Platform (Skia rendering) |
| 简单的数据录入表单、内部工具 | WinForms | Blazor (Static SSR), WPF |
| 像素级完美的跨平台UI | Uno Platform (Skia rendering) | Avalonia |
| 各平台原生外观 | MAUI (native controls) | Uno Platform (native mode) |
| 在桌面/移动应用中嵌入Web内容 | Blazor Hybrid in MAUI | Blazor Hybrid in WPF/WinForms |
Step 4: Performance Needs
步骤4:性能需求
Framework rendering architecture affects performance characteristics.
| Performance Factor | WinUI 3 | WPF | WinForms | Blazor Server | Blazor WASM | MAUI | Uno Platform |
|---|---|---|---|---|---|---|---|
| Startup time | Fast | Fast | Fast | Fast (server) | Slow (download) | Moderate | Moderate |
| Rendering | DirectX (native) | DirectX (managed) | GDI+ | Server-side HTML | Browser DOM | Platform-native | Skia or native |
| AOT support | N/A (Windows) | N/A (Windows) | N/A (Windows) | N/A (server) | Yes (.NET 8+) | Yes (required on iOS) | Yes (WASM) |
| GPU acceleration | Yes | Yes | Limited | N/A | Browser GPU | Platform GPU | Skia GPU |
| Memory per user | Local only | Local only | Local only | Server circuit | Browser sandbox | Local only | Local only |
| Offline capable | Yes | Yes | Yes | No | Yes | Yes | Yes (native targets) |
框架渲染架构会影响性能特征。
| 性能因素 | WinUI 3 | WPF | WinForms | Blazor Server | Blazor WASM | MAUI | Uno Platform |
|---|---|---|---|---|---|---|---|
| 启动时间 | 快 | 快 | 快 | 快(服务器端) | 慢(需下载) | 中等 | 中等 |
| 渲染方式 | DirectX(原生) | DirectX(托管) | GDI+ | 服务器端HTML | 浏览器DOM | 平台原生 | Skia或原生 |
| AOT支持 | N/A(Windows) | N/A(Windows) | N/A(Windows) | N/A(服务器端) | 是(.NET 8+) | 是(iOS必需) | 是(WASM) |
| GPU加速 | 是 | 是 | 有限 | N/A | 浏览器GPU | 平台GPU | Skia GPU |
| 每用户内存占用 | 仅本地 | 仅本地 | 仅本地 | 服务器连接会话 | 浏览器沙箱 | 仅本地 | 仅本地 |
| 离线支持 | 是 | 是 | 是 | 否 | 是 | 是 | 是(原生目标平台) |
Step 5: Migration Path
步骤5:迁移路径
If modernizing an existing application, the source framework constrains viable targets.
| Current Framework | Natural Target | Alternative Target | Decision Factors |
|---|---|---|---|
| UWP | WinUI 3 | Uno Platform | Windows-only: WinUI 3. Cross-platform needed: Uno Platform. |
| Xamarin.Forms | MAUI | Uno Platform | Direct API successor: MAUI. Broader platform reach: Uno Platform. |
| WPF (.NET Framework) | WPF on .NET 8+ | WinUI 3 or Uno Platform | Minimal risk: WPF .NET 8+. Modern UI: WinUI 3. Cross-platform: Uno Platform. |
| WinForms (.NET Framework) | WinForms on .NET 8+ | Blazor or WPF | Minimal risk: WinForms .NET 8+. Better UI: WPF. Web delivery: Blazor. |
| ASP.NET MVC / Razor Pages | Blazor (Static SSR) | Stay on Razor Pages | Interactive needs: Blazor. Content-heavy: Razor Pages is still valid. |
| React / Angular SPA | Blazor WebAssembly | Keep existing SPA | .NET-only team: Blazor. Existing JS team: keep SPA. |
如果是现代化改造现有应用,源框架会限制可行的目标选项。
| 当前框架 | 自然迁移目标 | 替代迁移目标 | 决策因素 |
|---|---|---|---|
| UWP | WinUI 3 | Uno Platform | 仅Windows平台:WinUI 3。需要跨平台:Uno Platform。 |
| Xamarin.Forms | MAUI(直接继任者) | Uno Platform | 直接API继任者:MAUI。更广泛的平台覆盖:Uno Platform。 |
| WPF(.NET Framework) | .NET 8+上的WPF | WinUI 3或Uno Platform | 最小风险:.NET 8+上的WPF。现代UI:WinUI 3。跨平台:Uno Platform。 |
| WinForms(.NET Framework) | .NET 8+上的WinForms | Blazor或WPF | 最小风险:.NET 8+上的WinForms。更好的UI:WPF。Web交付:Blazor。 |
| ASP.NET MVC / Razor Pages | Blazor(Static SSR) | 保留Razor Pages | 需要交互性:Blazor。内容为主:Razor Pages仍适用。 |
| React / Angular SPA | Blazor WebAssembly | 保留现有SPA | 纯.NET团队:Blazor。现有JS团队:保留SPA。 |
Blazor Hosting Model Selection
Blazor托管模型选择
When Blazor is the target, select a hosting model based on interactivity needs, deployment constraints, and scale.
| Concern | Static SSR | InteractiveServer | InteractiveWebAssembly | InteractiveAuto | Blazor Hybrid |
|---|---|---|---|---|---|
| Interactivity | Forms only | Full | Full (after download) | Full | Full (native) |
| Server required | Yes (render) | Yes (persistent circuit) | Static file host only | Yes (initial), then static | No |
| Offline | No | No | Yes | Partial | Yes |
| Scalability | High | Limited by circuits | High | High (after WASM) | N/A (local) |
| First paint | Fast | Fast | Slow (WASM download) | Fast (Server first) | Instant |
| SEO | Yes | Prerender | Prerender | Prerender | N/A |
| Best for | Content sites, simple forms | Dashboards, LOB apps | Public apps, offline PWAs | Best of both worlds | Desktop/mobile with web UI |
For detailed Blazor patterns, see [skill:dotnet-blazor-patterns].
当目标框架为Blazor时,根据交互需求、部署约束和扩展性选择托管模型。
| 关注点 | Static SSR | InteractiveServer | InteractiveWebAssembly | InteractiveAuto | Blazor Hybrid |
|---|---|---|---|---|---|
| 交互性 | 仅表单 | 完整 | 完整(下载后) | 完整 | 完整(原生) |
| 是否需要服务器 | 是(渲染) | 是(持久连接会话) | 仅需静态文件托管 | 是(初始阶段),之后静态 | 否 |
| 离线支持 | 否 | 否 | 是 | 部分支持 | 是 |
| 扩展性 | 高 | 受连接会话限制 | 高 | 高(WASM加载后) | N/A(本地运行) |
| 首次渲染速度 | 快 | 快 | 慢(WASM下载) | 快(先服务器渲染) | 即时 |
| SEO支持 | 是 | 预渲染 | 预渲染 | 预渲染 | N/A |
| 最佳适用场景 | 内容站点、简单表单 | 仪表板、LOB应用 | 公共Web应用、PWA | 兼顾两者优势 | 原生外壳中的Web UI(移动/桌面) |
Blazor详细模式请参考[skill:dotnet-blazor-patterns]。
Windows Framework Selection
Windows框架选择
When the application targets Windows only, choose based on UI richness, team expertise, and modernization goals.
当应用仅针对Windows平台时,根据UI丰富度、团队专业技能和现代化目标进行选择。
Comparison Table
对比表格
| Concern | WinUI 3 | WPF (.NET 8+) | WinForms (.NET 8+) |
|---|---|---|---|
| UI paradigm | Modern XAML, Fluent Design | Classic XAML, optional Fluent (.NET 9+) | Designer-driven, drag-and-drop |
| Rendering | DirectX (Windows App SDK) | DirectX (WPF layer) | GDI+ |
| MVVM support | CommunityToolkit.Mvvm | CommunityToolkit.Mvvm, mature ecosystem | Possible but not idiomatic |
| DI / Host builder | Yes | Yes | Yes (.NET 8+) |
| High-DPI | Native | Improved in .NET 8+ | PerMonitorV2 (requires config) |
| Dark mode | Native Fluent | Application.ThemeMode (.NET 9+) | Experimental (.NET 9+) |
| Touch / pen | Full support | Basic support | Limited |
| Learning curve | Moderate (XAML) | Moderate (XAML) | Low |
| Maturity | Newer (2021+) | Very mature (2006+) | Very mature (2002+) |
| UWP migration path | Direct | Indirect (XAML differences) | N/A |
| 关注点 | WinUI 3 | WPF(.NET 8+) | WinForms(.NET 8+) |
|---|---|---|---|
| UI范式 | 现代XAML、Fluent设计 | 经典XAML,可选Fluent(.NET 9+) | 设计器驱动、拖拽式 |
| 渲染方式 | DirectX(Windows App SDK) | DirectX(WPF层) | GDI+ |
| MVVM支持 | CommunityToolkit.Mvvm | CommunityToolkit.Mvvm、成熟生态系统 | 可行但非惯用方式 |
| DI / Host builder | 是 | 是 | 是(.NET 8+) |
| 高DPI支持 | 原生支持 | .NET 8+中已改进 | PerMonitorV2(需配置) |
| 深色模式 | 原生Fluent支持 | Application.ThemeMode(.NET 9+) | 实验性(.NET 9+) |
| 触摸/手写笔支持 | 完整支持 | 基础支持 | 有限支持 |
| 学习曲线 | 中等(XAML) | 中等(XAML) | 低 |
| 成熟度 | 较新(2021+) | 非常成熟(2006+) | 非常成熟(2002+) |
| UWP迁移路径 | 直接迁移 | 间接(XAML差异) | N/A |
When to Choose Each
各框架适用场景
WinUI 3 -- best for new Windows-native applications that need modern Fluent Design, touch/pen input, and the latest Windows integration (widgets, notifications, Mica). Requires Windows 10 2004+. See [skill:dotnet-winui].
WPF on .NET 8+ -- best for teams with existing WPF expertise, applications that need the rich WPF control ecosystem, or projects migrating from WPF on .NET Framework. Fluent theme available in .NET 9+. See [skill:dotnet-wpf-modern].
WinForms on .NET 8+ -- best for rapid prototyping, internal tools, simple CRUD forms, and Windows utilities where development speed matters more than UI polish. Simplest learning curve. See [skill:dotnet-winforms-basics].
WinUI 3——最适合需要现代Fluent设计、触摸/手写笔输入以及最新Windows集成(小组件、通知、Mica效果)的全新Windows原生应用。要求Windows 10 2004+系统。请参考[skill:dotnet-winui]。
WPF on .NET 8+——最适合拥有现有WPF专业技能的团队、需要丰富WPF控件生态系统的应用,或从.NET Framework上的WPF迁移的项目。.NET 9+中提供Fluent主题。请参考[skill:dotnet-wpf-modern]。
WinForms on .NET 8+——最适合快速原型开发、内部工具、简单CRUD表单以及Windows实用工具,这些场景中开发速度比UI精致度更重要。学习曲线最简单。请参考[skill:dotnet-winforms-basics]。
Cross-Platform Framework Selection
跨平台框架选择
When the application must run on multiple platforms, compare reach, rendering model, and API surface.
当应用必须在多平台运行时,对比平台覆盖范围、渲染模型和API层面。
Comparison Table
对比表格
| Concern | MAUI | Uno Platform | Avalonia |
|---|---|---|---|
| Target platforms | iOS, Android, macOS, Windows, Tizen | iOS, Android, macOS, Windows, Linux, Web (WASM) | iOS, Android, macOS, Windows, Linux, Web (WASM) |
| UI rendering | Platform-native controls | Skia (pixel-perfect) or platform-native | Skia (pixel-perfect) |
| XAML dialect | MAUI XAML (Xamarin.Forms successor) | WinUI XAML surface | Avalonia XAML (WPF-inspired) |
| Hot Reload | XAML + C# Hot Reload | XAML + C# Hot Reload | XAML Hot Reload |
| Maintainer | Microsoft (first-party) | Uno Platform (open source, commercial support) | Community (open source, commercial support) |
| Ecosystem | NuGet + MAUI Community Toolkit | NuGet + Uno Toolkit + Uno Extensions | NuGet + Avalonia community |
| Blazor Hybrid | Built-in (BlazorWebView) | Supported | Not built-in |
| Linux desktop | Not supported | Supported (Skia + GTK/Framebuffer) | Supported |
| Web (WASM) | Not supported | Supported | Supported (browser) |
| Migration from | Xamarin.Forms (direct) | UWP (direct WinUI surface) | WPF (similar XAML) |
| 关注点 | MAUI | Uno Platform | Avalonia |
|---|---|---|---|
| 目标平台 | iOS、Android、macOS、Windows、Tizen | iOS、Android、macOS、Windows、Linux、Web(WASM) | iOS、Android、macOS、Windows、Linux、Web(WASM) |
| UI渲染方式 | 平台原生控件 | Skia(像素级完美)或平台原生 | Skia(像素级完美) |
| XAML方言 | MAUI XAML(Xamarin.Forms继任者) | WinUI XAML层面 | Avalonia XAML(WPF启发) |
| 热重载 | XAML + C#热重载 | XAML + C#热重载 | XAML热重载 |
| 维护方 | 微软(官方) | Uno Platform(开源、商业支持) | 社区(开源、商业支持) |
| 生态系统 | NuGet + MAUI Community Toolkit | NuGet + Uno Toolkit + Uno Extensions | NuGet + Avalonia社区 |
| Blazor Hybrid支持 | 内置(BlazorWebView) | 支持 | 非内置 |
| Linux桌面支持 | 不支持 | 支持(Skia + GTK/Framebuffer) | 支持 |
| Web(WASM)支持 | 不支持 | 支持 | 支持(浏览器) |
| 迁移来源 | Xamarin.Forms(直接迁移) | UWP(直接WinUI层面) | WPF(相似XAML) |
When to Choose Each
各框架适用场景
MAUI -- best for mobile-first apps targeting iOS and Android with optional Windows/macOS support. Platform-native controls provide OS-native look and feel. Direct migration path from Xamarin.Forms. See [skill:dotnet-maui-development].
Uno Platform -- best for apps that need the broadest platform reach (including Linux and Web) with a single XAML codebase. Uses WinUI XAML API surface, making it a natural path for UWP or WinUI teams going cross-platform. See [skill:dotnet-uno-platform].
Avalonia -- community-driven cross-platform framework with WPF-inspired XAML. Strong Linux desktop support. Consider when WPF-style development is preferred and community-maintained tooling is acceptable. Not owned by this plugin -- see Avalonia documentation for details.
MAUI——最适合以移动为先、针对iOS和Android且可选支持Windows/macOS的应用。平台原生控件提供操作系统原生外观和体验。是Xamarin.Forms的直接迁移路径。请参考[skill:dotnet-maui-development]。
Uno Platform——最需要最广泛平台覆盖(包括Linux和Web)且使用单一XAML代码库的应用。采用WinUI XAML API层面,是UWP或WinUI团队转向跨平台的自然选择。请参考[skill:dotnet-uno-platform]。
Avalonia——社区驱动的跨平台框架,采用WPF启发的XAML。Linux桌面支持出色。当偏好WPF风格开发且接受社区维护工具时可以考虑。本插件未涵盖该框架——详情请参考Avalonia文档。
Trade-Off Summary Matrix
权衡总结矩阵
A consolidated view across all frameworks for quick reference.
| Framework | Platforms | Rendering | XAML | Offline | AOT | Best For |
|---|---|---|---|---|---|---|
| Blazor Server | Web | Server HTML | Razor | No | N/A | LOB apps, dashboards |
| Blazor WASM | Web | Browser DOM | Razor | Yes | Yes | Public web apps, PWAs |
| Blazor Hybrid | Mobile + Desktop | WebView | Razor | Yes | Partial | Web UI in native shell |
| MAUI | Mobile + Desktop | Native | MAUI XAML | Yes | iOS required | Mobile-first apps |
| Uno Platform | All | Skia / Native | WinUI XAML | Yes | WASM | Broadest reach |
| Avalonia | Desktop + Mobile | Skia | Avalonia XAML | Yes | Partial | Linux desktop, WPF teams |
| WinUI 3 | Windows | DirectX | WinUI XAML | Yes | N/A | Modern Windows apps |
| WPF | Windows | DirectX | WPF XAML | Yes | N/A | Mature Windows apps |
| WinForms | Windows | GDI+ | None (designer) | Yes | N/A | Internal tools, prototypes |
所有框架的综合视图,便于快速参考。
| 框架 | 平台 | 渲染方式 | XAML | 离线支持 | AOT | 最佳适用场景 |
|---|---|---|---|---|---|---|
| Blazor Server | Web | 服务器端HTML | Razor | 否 | N/A | LOB应用、仪表板 |
| Blazor WASM | Web | 浏览器DOM | Razor | 是 | 是 | 公共Web应用、PWA |
| Blazor Hybrid | 移动+桌面 | WebView | Razor | 是 | 部分支持 | 原生外壳中的Web UI |
| MAUI | 移动+桌面 | 原生 | MAUI XAML | 是 | iOS必需 | 移动为先的应用 |
| Uno Platform | 全平台 | Skia / 原生 | WinUI XAML | 是 | WASM支持 | 最广泛的平台覆盖 |
| Avalonia | 桌面+移动 | Skia | Avalonia XAML | 是 | 部分支持 | Linux桌面、WPF团队 |
| WinUI 3 | Windows | DirectX | WinUI XAML | 是 | N/A | 现代Windows应用 |
| WPF | Windows | DirectX | WPF XAML | 是 | N/A | 成熟Windows应用 |
| WinForms | Windows | GDI+ | 无(设计器) | 是 | N/A | 内部工具、原型 |
Common Decision Scenarios
常见决策场景
Structured guidance for frequently encountered situations. Each scenario presents the trade-offs rather than a single answer.
Scenario: New internal business application (Windows-only users)
- Quick delivery, minimal UI: WinForms
- Rich UI with data visualization: WPF or WinUI 3
- Web deployment preferred: Blazor Server (InteractiveServer)
- Future cross-platform possibility: Uno Platform or Blazor
Scenario: Customer-facing mobile app
- iOS + Android, native look: MAUI
- iOS + Android + Web: Uno Platform or Blazor Hybrid in MAUI
- Existing web team: Blazor Hybrid in MAUI
Scenario: Modernizing a legacy .NET Framework WPF application
- Minimal disruption: Migrate WPF to .NET 8+ (same XAML, modern runtime)
- Modern UI refresh (Windows-only): Migrate to WinUI 3
- Cross-platform needed: Migrate to Uno Platform (WinUI XAML surface)
- Web delivery needed: Rewrite critical flows in Blazor
Scenario: Public-facing web application
- Content-heavy, SEO: Blazor Static SSR
- Interactive SPA: Blazor WebAssembly or InteractiveAuto
- Real-time dashboards: Blazor Server (InteractiveServer)
Scenario: Desktop application targeting Windows, macOS, and Linux
- Pixel-perfect UI: Uno Platform (Skia) or Avalonia
- MAUI does not support Linux desktop
针对常见场景的结构化指导。每个场景仅呈现权衡关系而非单一答案。
场景:全新内部业务应用(仅Windows用户)
- 快速交付、极简UI:WinForms
- 丰富UI与数据可视化:WPF或WinUI 3
- 偏好Web部署:Blazor Server(InteractiveServer)
- 未来可能需要跨平台:Uno Platform或Blazor
场景:面向客户的移动应用
- iOS + Android、原生外观:MAUI
- iOS + Android + Web:Uno Platform或MAUI中的Blazor Hybrid
- 现有Web团队:MAUI中的Blazor Hybrid
场景:现代化改造遗留.NET Framework WPF应用
- 最小化干扰:将WPF迁移到.NET 8+(相同XAML、现代运行时)
- 现代UI刷新(仅Windows):迁移到WinUI 3
- 需要跨平台:迁移到Uno Platform(WinUI XAML层面)
- 需要Web交付:重写关键流程为Blazor
场景:面向公众的Web应用
- 内容为主、SEO需求:Blazor Static SSR
- 交互式SPA:Blazor WebAssembly或InteractiveAuto
- 实时仪表板:Blazor Server(InteractiveServer)
场景:针对Windows、macOS和Linux的桌面应用
- 像素级完美UI:Uno Platform(Skia)或Avalonia
- MAUI不支持Linux桌面
Agent Gotchas
Agent注意事项
- Do not recommend a single framework as "the best." Every framework has trade-offs. Present options with trade-offs and let the team decide based on their constraints.
- Do not recommend WinForms for new customer-facing applications. WinForms is suitable for internal tools and prototypes but lacks modern UI capabilities for customer-facing products.
- Do not confuse MAUI with Uno Platform target coverage. MAUI does not support Linux or Web (WASM). Uno Platform does. Verify the required platform list before recommending.
- Do not assume Blazor WebAssembly works offline by default. WASM runs in the browser but offline support requires explicit PWA configuration (service worker, caching strategy).
- Do not conflate Avalonia with a Microsoft-supported framework. Avalonia is community-maintained. It has commercial support options but is not a Microsoft product.
- Do not suggest migrating UWP directly to WPF. UWP's natural migration target is WinUI 3 (same XAML API surface). WPF uses a different XAML dialect.
- Do not overlook Blazor Hybrid as a cross-platform option. Blazor Hybrid in MAUI allows web UI skills to apply to mobile/desktop apps. It is a viable alternative to learning native XAML.
- Do not assume WPF is legacy. WPF on .NET 8+ is actively maintained with new features (Fluent theme in .NET 9+, performance improvements). It remains a strong choice for Windows desktop.
- 不要推荐单一框架为“最佳选择”。每个框架都有其权衡之处。应呈现各选项的权衡关系,让团队根据自身约束条件做出决策。
- 不要推荐WinForms用于新的面向客户的应用。WinForms适用于内部工具和原型,但缺乏面向客户产品所需的现代UI能力。
- 不要混淆MAUI与Uno Platform的平台覆盖范围。MAUI不支持Linux或Web(WASM)平台,而Uno Platform支持。在推荐前请确认所需的平台列表。
- 不要默认认为Blazor WebAssembly支持离线使用。WASM在浏览器中运行,但离线支持需要显式的PWA配置(服务工作线程、缓存策略)。
- 不要将Avalonia视为微软支持的框架。Avalonia是社区维护的框架。它有商业支持选项,但并非微软产品。
- 不要建议将UWP直接迁移到WPF。UWP的自然迁移目标是WinUI 3(相同的XAML API层面)。WPF使用不同的XAML方言。
- 不要忽视Blazor Hybrid作为跨平台选项。MAUI中的Blazor Hybrid允许将Web UI技能应用于移动/桌面应用,是学习原生XAML之外的可行替代方案。
- 不要认为WPF已过时。.NET 8+上的WPF仍在积极维护,且具备新功能(.NET 9+中的Fluent主题、性能改进)。它仍是Windows桌面应用的优质选择。