Token导航 LogoToken导航

Agent Skill · 开发

dotnet-wpf-migration(dotnet wpf 迁移)

dotnet-wpf-migration 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

dotnet-wpf-migration 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 17,537。

总安装 399周安装 16GitHub Stars 15下载 129核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:dotnet-wpf-migration(dotnet wpf 迁移)
来源仓库:https://github.com/wshaddix/dotnet-skills
仓库路径:skills/dotnet-wpf-migration
安装命令:
npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-wpf-migration
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-wpf-migration

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

提供多种 Windows 桌面框架迁移路径指导。包括 WPF 到 .NET 8、WinUI 或 Uno 的迁移。附带决策矩阵,根据约束选择合适目标。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。适用于遗留系统跨平台改造与体验升级。

dotnet-wpf-migration 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/dotnet-wpf-migration

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-wpf-migr…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

dotnet-wpf-migration 怎么安装?

在终端执行 npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-wpf-migration。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

dotnet-wpf-migration 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

dotnet-wpf-migration 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

dotnet-wpf-migration 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

dotnet-wpf-migration 用的人多吗?

公开数据是累计安装 399 次,近一周安装 16 次,下载 129 次,GitHub 15 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

dotnet-wpf-migration 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
dotnet-wpf-migration

dotnet wpf 迁移 · 本页

39915需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

dotnet-wpf-migration

Context-dependent migration guidance for Windows desktop applications. Covers WPF.NET Framework to.NET 8+, WPF to WinUI 3 (Windows-only modernization), WPF to Uno Platform (cross-platform), WinForms.NET Framework to.NET 8+, UWP to WinUI 3, UWP to Uno Platform (cross-ref), and a decision matrix for choosing the right migration target based on project constraints.

Version assumptions:.NET 8.0+ baseline (current LTS). dotnet-upgrade-assistant for automated migration..NET 9 features explicitly marked where applicable.

Scope boundary: This skill owns migration paths between desktop frameworks and from.NET Framework to modern.NET. Individual framework patterns (WPF modern, WinUI, WinForms modern) are owned by the respective framework skills. The framework selection decision tree is owned by [skill:dotnet-ui-chooser].

Out of scope: WPF.NET 8+ development patterns -- see [skill:dotnet-wpf-modern]. WinUI 3 development patterns -- see [skill:dotnet-winui]. WinForms.NET 8+ development patterns -- see [skill:dotnet-winforms-basics]. Uno Platform development patterns -- see [skill:dotnet-uno-platform]. Framework selection decision tree -- see [skill:dotnet-ui-chooser]. Desktop testing -- see [skill:dotnet-ui-testing-core].

Cross-references: [skill:dotnet-wpf-modern] for WPF.NET 8+ patterns, [skill:dotnet-winui] for WinUI 3 patterns, [skill:dotnet-winforms-basics] for WinForms.NET 8+ patterns, [skill:dotnet-uno-platform] for Uno Platform patterns, [skill:dotnet-ui-chooser] for framework selection, [skill:dotnet-ui-testing-core] for desktop testing.


Migration Path Overview

Choose a migration path based on your current framework and target goals. Each path has different trade-offs in effort, risk, and capability gain.

CurrentTargetEffortRiskWhen to Choose
WPF.NET FrameworkWPF.NET 8+Low-MediumLowModernize runtime, keep existing UI
WPF.NET FrameworkWinUI 3HighMediumModern Windows UI, touch/pen, Fluent
WPF.NET FrameworkUno PlatformHighMedium-HighCross-platform needed
WinForms.NET FrameworkWinForms.NET 8+LowLowModernize runtime, keep existing UI
UWPWinUI 3MediumMediumStay Windows-only, modern runtime
UWPUno PlatformMedium-HighMediumCross-platform needed from UWP

WPF.NET Framework to.NET 8+

The lowest-risk migration path. Keeps your existing XAML and code-behind intact while moving to modern.NET with better performance, DI support, and side-by-side deployment.

Using dotnet-upgrade-assistant

The.NET Upgrade Assistant automates the bulk of the migration:

# Install the upgrade assistant
dotnet tool install -g upgrade-assistant

# Analyze the project first (non-destructive)
upgrade-assistant analyze MyWpfApp.sln

# Upgrade the project
upgrade-assistant upgrade MyWpfApp.sln

What the upgrade assistant handles:

  • .csproj conversion from legacy format to SDK-style
  • packages.config to PackageReference migration
  • TFM change to net8.0-windows
  • AssemblyInfo.cs properties moved to .csproj
  • Common API replacements and namespace updates

What requires manual work:

  • App.config settings migration to appsettings.json or Host builder configuration
  • Settings.settings / My.Settings (VB.NET) migration
  • Third-party control library updates (check vendor.NET 8 compatibility)
  • WCF client references (use CoreWCF or migrate to gRPC/REST)
  • COM interop adjustments (syntax differences in System.Runtime.InteropServices)
  • Custom MSBuild targets and build scripts

API Compatibility

Most WPF APIs are identical between.NET Framework and.NET 8+. Key differences:

Area.NET Framework.NET 8+Action
ClipboardClipboard.SetText()Same APINo change
PrintingPrintDialog, PrintVisualSame APINo change
BitmapEffectDeprecated (software-rendered)RemovedUse Effect / ShaderEffect
DrawingContext.PushEffectAvailableRemovedUse ShaderEffect
XPS documentsSystem.Windows.XpsRequires NuGet packageAdd System.Windows.Xps PackageReference
Speech synthesisSystem.SpeechRequires NuGet packageAdd System.Speech PackageReference

NuGet Package Updates

After migration, update NuGet packages to.NET 8-compatible versions:

# List outdated packages
dotnet list package --outdated

# Update packages (one at a time for safer migration)
dotnet add package Newtonsoft.Json --version 13.*
dotnet add package MaterialDesignThemes --version 5.*

Common package replacements:

  • Unity container -> Microsoft.Extensions.DependencyInjection (built-in)
  • Autofac -> update to latest (supports.NET 8)
  • log4net / NLog -> consider Microsoft.Extensions.Logging with Serilog or NLog provider
  • EntityFramework (EF6) -> Microsoft.EntityFrameworkCore 8.x

Breaking Changes Checklist

  • Default high-DPI behavior changed..NET 8 WPF enables PerMonitorV2 DPI awareness by default (not SystemAware like.NET Framework).
  • Nullable reference types. New projects enable NRT. Existing code may produce warnings. Suppress with <Nullable>disable</Nullable> initially, then fix incrementally.
  • Implicit usings. New SDK-style projects enable implicit usings. May conflict with existing using statements. Disable with <ImplicitUsings>disable</ImplicitUsings> if needed.
  • Assembly loading. AssemblyLoadContext replaces AppDomain for assembly isolation. Plugin architectures using AppDomain.CreateDomain need rework.
  • Runtime behavior..NET 8 GC is more aggressive with Gen0/Gen1 collections. Finalizer-dependent code may behave differently.

For post-migration WPF patterns (Host builder, MVVM Toolkit, modern C#), see [skill:dotnet-wpf-modern].


WPF to WinUI 3

Migrate when you need modern Windows-native UI: Fluent Design, touch/pen input, Windows 11 integration (widgets, Mica), or UWP-style APIs on modern.NET. This is a partial rewrite -- XAML concepts transfer but APIs and namespaces differ.

When This Path Makes Sense

  • Application is Windows-only and will stay Windows-only
  • Need modern Fluent Design controls, touch/pen support, or Windows 11 features
  • Team is willing to invest in XAML rewrite effort
  • Application is actively developed with ongoing feature work (justifies the investment)

When to Consider Alternatives

  • If cross-platform is needed -> migrate to Uno Platform instead (WinUI XAML surface)
  • If application is in maintenance mode -> migrate to WPF.NET 8+ instead (lower effort)
  • If WPF Fluent theme (.NET 9+) is sufficient -> stay on WPF.NET 8+ with ThemeMode = ThemeMode.System

XAML Differences

WPF XAMLWinUI 3 XAMLNotes
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"Same URI (but resolves to Microsoft.UI.Xaml types, not System.Windows)No xmlns change, but runtime types differ
{Binding Path=Name}{x:Bind Name, Mode=OneWay}Prefer x:Bind (compiled, type-safe)
DataContext bindingCode-behind property + x:Bindx:Bind resolves against code-behind
Window inherits from System.Windows.WindowWindow inherits from Microsoft.UI.Xaml.WindowDifferent base class and API
UserControlUserControl (Microsoft.UI.Xaml namespace)Same concept, different namespace
Style with TargetTypeSameWorks the same way
DataTemplateNeeds x:DataType for x:BindRequired for compiled bindings
ContextMenuMenuFlyoutDifferent control type
StatusBarNo built-in equivalentUse custom CommandBar or InfoBar
RibbonControlNo built-in equivalentUse NavigationView + CommandBar

Migration Strategy

  1. Create a new WinUI 3 project alongside the existing WPF project
  2. Migrate shared logic first -- Models, Services, ViewModels (if using MVVM Toolkit, they work in both)
  3. Migrate views incrementally -- start with simpler pages, then complex ones
  4. Replace WPF-specific controls with WinUI equivalents (see table above)
  5. Update data binding from {Binding} to {x:Bind} for compile-time safety
  6. Test Windows integration features (notifications, lifecycle, file associations)
  7. Choose deployment model -- MSIX (app identity) or unpackaged (xcopy)

For WinUI 3 patterns and project setup, see [skill:dotnet-winui].


WPF to Uno Platform

Migrate when you need cross-platform reach from a WPF codebase. Uno Platform uses the WinUI XAML API surface, so WPF XAML skills transfer partially, but the migration involves adapting to WinUI XAML patterns.

When This Path Makes Sense

  • Application needs to run on multiple platforms (Windows, macOS, Linux, Web, mobile)
  • Team has WPF/XAML expertise that transfers to WinUI XAML surface
  • Willing to invest in cross-platform adaptation (platform-specific behaviors, responsive layouts)

When to Consider Alternatives

  • If Windows-only -> migrate to WinUI 3 (simpler, no cross-platform overhead)
  • If application is in maintenance mode -> migrate to WPF.NET 8+ (lowest effort)
  • If team has web skills -> consider Blazor for web delivery

Migration Approach

The migration from WPF to Uno Platform is similar to WPF to WinUI 3 (since Uno uses the WinUI API surface), with additional cross-platform considerations:

  1. Create an Uno Platform project with the desired target platforms
  2. Migrate ViewModels and services -- these are platform-independent
  3. Adapt XAML to WinUI syntax (same changes as WPF to WinUI migration)
  4. Handle platform-specific features using conditional compilation or Uno platform extensions
  5. Replace Windows-only APIs with cross-platform alternatives (file dialogs, notifications, etc.)
  6. Test each target platform -- rendering and behavior may differ across Skia and native targets

Uno Extensions for Common Patterns

Uno Extensions provides cross-platform replacements for common WPF patterns:

WPF PatternUno Extensions Replacement
Custom navigationUno.Extensions.Navigation
Manual DI setupUno.Extensions.DependencyInjection (wraps MS DI)
appsettings.json configUno.Extensions.Configuration
Manual HTTP clientsUno.Extensions.Http (typed clients with Refit)
Manual serializationUno.Extensions.Serialization

For Uno Platform development patterns, see [skill:dotnet-uno-platform]. For per-target deployment guidance, see [skill:dotnet-uno-targets].


WinForms.NET Framework to.NET 8+

Similar to WPF migration but typically simpler due to WinForms' less complex project structure.

Using dotnet-upgrade-assistant

# Analyze first
upgrade-assistant analyze MyWinFormsApp.sln

# Upgrade
upgrade-assistant upgrade MyWinFormsApp.sln

What the upgrade assistant handles:

  • .csproj conversion to SDK-style with <UseWindowsForms>true</UseWindowsForms>
  • TFM change to net8.0-windows
  • packages.config to PackageReference
  • AssemblyInfo.cs migration to project properties

What requires manual work:

  • App.config / Settings.settings migration
  • My.Settings (VB.NET) migration to modern configuration
  • Third-party control library updates (some WinForms controls may lack.NET 8 support)
  • Crystal Reports or other legacy reporting tools (evaluate alternatives)
  • COM interop adjustments

Designer Compatibility

WinForms designer files (.Designer.cs) generally migrate cleanly. The Visual Studio WinForms designer for.NET 8+ is fully supported.

Known designer issues:

  • Custom designer serializers may need updates
  • Some third-party controls may not render in the.NET 8 designer
  • DPI-unaware designer mode available in.NET 9+ (<ForceDesignerDPIUnaware>true</ForceDesignerDPIUnaware>)

Post-Migration Modernization

After migrating to.NET 8+, consider adopting modern patterns incrementally:

  • Add dependency injection via Host builder (see [skill:dotnet-winforms-basics])
  • Replace synchronous calls with async/await
  • Enable high-DPI with PerMonitorV2 mode
  • Enable dark mode (experimental in.NET 9+)

For WinForms.NET 8+ patterns, see [skill:dotnet-winforms-basics].


UWP to WinUI 3

UWP's natural migration target. WinUI 3 uses the same XAML API surface with namespace changes.

Namespace Changes

The primary migration task is updating namespaces from Windows.UI.* to Microsoft.UI.*:

UWP NamespaceWinUI 3 Namespace
Windows.UI.XamlMicrosoft.UI.Xaml
Windows.UI.Xaml.ControlsMicrosoft.UI.Xaml.Controls
Windows.UI.Xaml.MediaMicrosoft.UI.Xaml.Media
Windows.UI.CompositionMicrosoft.UI.Composition
Windows.UI.TextMicrosoft.UI.Text

Keep as-is: Windows.Storage, Windows.Networking, Windows.Security, Windows.ApplicationModel, Windows.Devices -- these WinRT APIs remain unchanged.

App Model Differences

ConcernUWPWinUI 3
App lifecycleCoreApplication + suspensionWindows App SDK AppInstance
Window managementWindow.Current (singleton)Track window references manually
DispatcherCoreDispatcher.RunAsyncDispatcherQueue.TryEnqueue
Background tasksBuilt-in, requires package identityAvailable with MSIX, limited without
File accessBroad capabilities via manifestStandard Win32 file access + StorageFile
Store APIsWindows.Services.StoreSame (still available)

Migration Steps

  1. Create a new WinUI 3 project using the Windows App SDK template
  2. Copy source files and update namespaces (Windows.UI.Xaml to Microsoft.UI.Xaml)
  3. Replace deprecated APIs (Window.Current to manual tracking, CoreDispatcher to DispatcherQueue)
  4. Update MSIX manifest from UWP format to Windows App SDK format
  5. Migrate capabilities -- review and update capability declarations
  6. Update NuGet packages to Windows App SDK-compatible versions
  7. Test Windows integration -- notifications, background tasks, file associations may behave differently

UWP.NET 9 preview path: Microsoft announced UWP support on.NET 9 as a preview. If full WinUI 3 migration is too costly, this allows UWP apps to use modern.NET runtime features without migrating the UI framework.

For WinUI 3 development patterns, see [skill:dotnet-winui].


UWP to Uno Platform

When cross-platform reach is needed from a UWP codebase. Uno Platform implements the WinUI XAML API surface, making it the most natural cross-platform migration path for UWP.

Since Uno Platform uses the same WinUI XAML API surface that UWP XAML is based on, much of the UWP code transfers with fewer changes than migrating to other cross-platform frameworks:

  • XAML files often work with minimal changes (Uno supports x:Bind, x:Load, etc.)
  • ViewModels and services transfer directly (platform-independent code)
  • Windows-specific APIs need cross-platform alternatives for non-Windows targets

Key Considerations

  • Platform-specific code using Windows.* APIs needs conditional compilation or abstraction for non-Windows targets
  • WinRT APIs (sensors, geolocation, media capture) need Uno implementations or platform-specific alternatives
  • MSIX packaging is Windows-only -- other platforms use their native distribution mechanisms

For Uno Platform development patterns, see [skill:dotnet-uno-platform]. For per-target deployment, see [skill:dotnet-uno-targets].


Decision Matrix

Use this matrix when deciding which migration path to take. The right choice depends on your specific constraints -- there is no universal "best" migration target.

By Primary Goal

GoalRecommended PathAlternative
Lowest risk, fastest migrationWPF/WinForms to.NET 8+--
Modern Windows UIWPF to WinUI 3WPF.NET 9+ with Fluent theme
Cross-platform from Windows appWPF to Uno PlatformRewrite critical paths in Blazor
Cross-platform from UWPUWP to Uno PlatformUWP to WinUI 3 (stay Windows-only)
UWP modernization (Windows-only)UWP to WinUI 3UWP on.NET 9 preview
Legacy WinForms modernizationWinForms to.NET 8+Gradual rewrite in Blazor or WPF

By Constraint

ConstraintBest PathRationale
Limited budget/time.NET 8+ migration (same framework)Lowest effort, same codebase
Must stay Windows-onlyWinUI 3 or WPF.NET 8+WinUI for modern UI; WPF for minimal change
Must go cross-platformUno PlatformBroadest reach with WinUI XAML surface
Large existing WPF codebaseWPF.NET 8+ first, then evaluateStabilize on modern runtime before UI rewrite
Existing UWP codebaseWinUI 3 (Windows) or Uno (cross-platform)Closest API surface to existing code
Team has web skillsBlazor (rewrite)Leverage web expertise for desktop/mobile

Staged Migration Strategy

For large applications, a staged approach reduces risk:

  1. Stage 1: Runtime migration -- Move from.NET Framework to.NET 8+ (same UI framework). Validates compatibility, gains performance, enables modern NuGet packages.
  2. Stage 2: Modernize patterns -- Adopt Host builder, DI, MVVM Toolkit, modern C#. See [skill:dotnet-wpf-modern] or [skill:dotnet-winforms-basics].
  3. Stage 3: UI migration (if needed) -- Migrate to WinUI 3, Uno Platform, or Blazor based on requirements. Only pursue if Stage 1 and 2 are stable.

This approach avoids the "big bang" rewrite risk and delivers incremental value at each stage.


Agent Gotchas

  1. Do not recommend a single migration target as "the right choice" without understanding constraints. Always present options with trade-offs. Budget, timeline, team expertise, and platform requirements all affect the decision.
  2. Do not skip the.NET 8+ runtime migration before suggesting a UI framework change. Moving from.NET Framework to.NET 8+ (same UI framework) should be Stage 1. A WPF-to-WinUI migration from.NET Framework is significantly harder than from.NET 8+.
  3. Do not assume WPF is "legacy" and must be migrated away. WPF on.NET 8+ is actively maintained with new features (Fluent theme in.NET 9+, performance improvements). Many applications are well-served by staying on WPF.
  4. Do not use dotnet-upgrade-assistant without running analyze first. Always analyze before upgrading to understand the scope of changes and potential issues.
  5. Do not conflate WPF XAML with WinUI XAML. While concepts are similar, the API surfaces differ (Window, DataContext vs x:Bind, NavigationView patterns). Migration requires more than namespace changes.
  6. Do not forget that UWP to WinUI 3 migration involves app model changes, not just namespace updates. Window.Current, CoreDispatcher, CoreApplication APIs are all replaced with different patterns.
  7. Do not recommend Uno Platform for simple Windows-only apps. If the application does not need cross-platform reach, WinUI 3 or WPF.NET 8+ is simpler and has lower maintenance overhead.

References

平台分布

Codex

35.83%
按下载量换算46

Claude

29.58%
按下载量换算38

Cursor

19.92%
按下载量换算26

Gemini CLI

9.46%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills