Token导航 LogoToken导航TokenDH.com
前端设计external-servicegithub未标认证来源可访问许可证需确认审计通过

xamarin-forms-migrationXamarin 形成迁移

Agent Skill

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

总安装

420

周安装

17

GitHub Stars

129

下载量

132
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/davidortinau/maui-skills --skill xamarin-forms-migration

简介

xamarin-forms-migration 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。

  • 可结合来源仓库、安装命令和原始 README 继续核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 它主要面向开发者在协作流程中快速获取仓库上下文信息。
  • 适用于需要自动化处理代码审查和项目进度跟踪的场景。

SKILL.md

Xamarin.Forms →.NET MAUI Migration

For project templates, namespace tables, API deprecation tables, and reference code, see references/forms-migration-api.md.

⚠️ Do not use the.NET Upgrade Assistant. Apply namespace renames, project file updates, and package replacements directly. Build after each batch of changes and use compiler errors to guide the next round of fixes.

Migration Workflow

  1. Create new.NET MAUI project (single-project — multi-project causes AOT/build errors)
  2. Copy cross-platform code + platform code into Platforms/<platform>/
  3. Update namespaces (XAML + C# + Essentials — see references/forms-migration-api.md)
  4. Fix layout behavior changes (see below)
  5. Migrate renderers → handlers (not shimmed renderers)
  6. Migrate effects → behaviors
  7. Remove Microsoft.Maui.Controls.Compatibility package
  8. Update NuGet dependencies
  9. Migrate app data stores
  10. Delete bin//obj//Resource.designer.cs, build, test iteratively
  11. Verify against.NET 10 deprecated API list
Strategy: Create a new project and copy code into it — don't edit the existing project file in place.

Critical Layout Pitfalls

⚠️ Default Spacing Changed to Zero

MAUI zeroes out spacing that Xamarin.Forms set to 6. Your layouts will break silently:

<!-- ❌ Looks fine in Xamarin.Forms, cramped in MAUI -->
<Grid>...</Grid>
<StackLayout>...</StackLayout>

<!-- ✅ Add explicit values or restore via implicit styles in App.xaml -->
<Style TargetType="Grid">
    <Setter Property="ColumnSpacing" Value="6"/>
    <Setter Property="RowSpacing" Value="6"/>
</Style>
Field advice: Specify all layout values explicitly — don't rely on platform defaults.

⚠️ *AndExpand Is Obsolete — No Silent Warning

<!-- ❌ Silently ignored in MAUI — image won't expand -->
<StackLayout>
    <Label Text="Hello world!"/>
    <Image VerticalOptions="FillAndExpand" Source="dotnetbot.png"/>
</StackLayout>

<!-- ✅ Convert to Grid with star sizing -->
<Grid RowDefinitions="Auto, *">
    <Label Text="Hello world!"/>
    <Image Grid.Row="1" Source="dotnetbot.png"/>
</Grid>
Field advice: Flatten layout trees. Replace nested hierarchies with single Grid layouts.

⚠️ ScrollView in StackLayout Doesn't Scroll

ScrollView inside StackLayout expands to full content height (no scroll). Place ScrollView in a Grid with a constrained row instead.

Other Layout Traps

IssueFix
Grid columns/rows not declared → layout brokenAlways add explicit ColumnDefinitions/RowDefinitions
Frame measures differentlyMigrate to Border with StrokeShape
BoxView invisible (default 0×0 in MAUI)Set explicit WidthRequest/HeightRequest
RelativeLayoutReplace with Grid (compatibility namespace only)

Renderer → Handler Migration

⚠️ Migrate all renderers to handlers. Do NOT use shimmed renderers — they create parent wrapper views that hurt performance.

Preferred: Customize existing handlers with mapper methods:

// ✅ Extend existing handler — no new class needed
Microsoft.Maui.Handlers.EntryHandler.Mapper.AppendToMapping("NoBorder", (handler, view) =>
{
#if ANDROID
    handler.PlatformView.Background = null;
#elif IOS || MACCATALYST
    handler.PlatformView.BorderStyle = UIKit.UITextBorderStyle.None;
#endif
});

For completely new native views, create a full handler (see maui-custom-handlers skill).

Effects → Behaviors

⚠️ Effects are now Behaviors — this requires redesign, not just renaming.

For new development, prefer behaviors or handler mapper customizations over effects.

⚠️ Do NOT Use the Compatibility Package

Microsoft.Maui.Controls.Compatibility causes cascading incompatibilities. Remove it and rebuild layouts natively.

Retired Dependencies

  • App Center is retired → Replace with Sentry, Azure Monitor, or similar
  • Visual Studio for Mac is retired → Use VS Code or Rider

Android-Specific Warnings

  • Android migration is significantly harder than iOS — expect more UI bugs
  • OEM-specific rendering differences not reproducible on emulators — test on physical devices
  • Shadow rendering varies across OEMs/API levels — implement in platform-specific handler code
  • Handler-level property changes don't auto-update on theme switch — manually handle theme changes

.NET 10 API Currency Warning

Migration is the perfect time to skip deprecated APIs entirely. Don't migrate Xamarin.Forms code to a MAUI API that's already on its way out. See the full deprecated API table in references/forms-migration-api.md and run the maui-current-apis skill.

Common Troubleshooting

IssueFix
Xamarin.* namespace doesn't existUpdate to Microsoft.Maui.* equivalent
CollectionView doesn't scrollPlace in Grid (not StackLayout) to constrain size
Pop-up under page on iOSUse DisplayAlert from the ContentPage
Missing padding/margin/spacingAdd explicit values or implicit styles
Custom renderer brokenMigrate to handler
SkiaSharp brokenUpdate to SkiaSharp.Views.Maui package
Can't access App.Properties dataMigrate to Preferences

Quick Checklist

  1. ☐ Created new.NET MAUI project (single-project)
  2. ☐ Copied cross-platform and platform code
  3. ☐ Updated XAML namespace to http://schemas.microsoft.com/dotnet/2021/maui
  4. ☐ Replaced Xamarin.Forms.*Microsoft.Maui.* namespaces
  5. ☐ Replaced Xamarin.Essentials → split MAUI namespaces
  6. ☐ Added explicit Grid ColumnDefinitions/RowDefinitions
  7. ☐ Replaced *AndExpand with Grid layouts
  8. ☐ Added explicit spacing/padding values (MAUI defaults to 0)
  9. ☐ Migrated renderers to handlers (not shimmed renderers)
  10. ☐ Migrated effects to behaviors or MAUI effects
  11. ☐ Removed Microsoft.Maui.Controls.Compatibility package
  12. ☐ Updated NuGet dependencies for.NET compatibility
  13. ☐ Migrated App.Properties, SecureStorage, VersionTracking data
  14. ☐ Deleted bin/, obj/, and Resource.designer.cs
  15. ☐ Tested on physical Android device
  16. ☐ Profiled performance
  17. ☐ Verified no.NET 10 deprecated APIs (run maui-current-apis skill)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.53%
按下载量换算47

Claude

30.15%
按下载量换算40

Cursor

15.85%
按下载量换算21

Gemini CLI

8.65%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

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

来源信息

继续浏览同类 Skills