dotnet/maui-labs/xamarin-forms-migration

Claude Code and agent skill by dotnet/maui-labs

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Plan Xamarin.Forms to MAUI migrations. USE FOR: audits, fresh `dotnet new maui`, namespace updates, `DependencyService` to DI, `MessagingCenter` replacement, renderer triage, `MauiProgram`, permissions, parity planning. DO NOT USE FOR: brand-new MAUI apps, native SDK bindings, backend.

Install

npx vskill@latest install dotnet/maui-labs/xamarin-forms-migration

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as dotnet/maui-labs/xamarin-forms-migration.

Xamarin.Forms Migration

Use this skill to move a Xamarin.Forms app to .NET MAUI without blindly copying obsolete patterns. Treat migration as an audit and phased rebuild on a fresh MAUI project unless the user explicitly needs a small tactical port.

Response Checklist

  • Call out the migration audit first (DependencyService, MessagingCenter,

custom renderers/effects, permissions, and platform capabilities).

  • Prefer a fresh MAUI project workflow and MauiProgram.cs DI setup.
  • Explicitly classify renderer replacements into mapper customization, custom

handler, platform service, or slim binding.

Migration Tooling

Before migrating manually, check whether the .NET Upgrade Assistant can cover the mechanical parts of the app:

bash
dotnet tool install -g upgrade-assistant
upgrade-assistant upgrade <your-solution>.sln

Upgrade Assistant can help with project conversion and namespace/API rewrites. Use this skill for decisions tooling cannot safely automate: renderer classification, DependencyService lifetimes, MessagingCenter replacement, platform capability parity, and validation planning.

Migration Workflow

  1. Inventory the current app:
  • Xamarin.Forms version, target platforms, platform projects, NuGet packages,

renderers, effects, DependencyService, MessagingCenter, and native SDKs.

  • App startup, navigation, resource dictionaries, images/fonts, and platform

entitlements/permissions.

  1. Create a new .NET MAUI project or solution structure that matches the target

app shape. Prefer this over editing the Xamarin.Forms project in place.

  1. Move shared code first: models, services, view models, converters, resources,

and XAML. Keep platform code out until shared code builds.

  1. Update namespaces and APIs using maui-current-apis; do not introduce new

Xamarin.Forms or Xamarin.Essentials references.

  1. Migrate app startup to MauiProgram.cs, CreateMauiApp, DI registration,

fonts, handlers, lifecycle events, and platform services.

  1. Migrate UI and navigation incrementally. Keep Shell route names, modal flows,

and deep-link behavior explicit.

  1. Plan custom renderer/effect replacements:
  • simple native property tweak -> handler mapper customization;
  • reusable custom control -> custom handler;
  • non-visual platform API -> platform service via DI;
  • third-party native SDK surface -> slim binding.
  1. Validate each migrated slice with build, platform launch, and accessibility or

performance checks for changed UI.

Common API Replacements

Xamarin.Forms-era patternMAUI direction
using Xamarin.Formsusing Microsoft.Maui.Controls
using Xamarin.EssentialsMicrosoft.Maui.ApplicationModel, Microsoft.Maui.Devices, Microsoft.Maui.Storage, or the specific MAUI namespace
Device.BeginInvokeOnMainThreadMainThread.BeginInvokeOnMainThread or Dispatcher.Dispatch
Device.StartTimerDispatcher.StartTimer or IDispatcherTimer
Device.RuntimePlatformDeviceInfo.Platform, OnPlatform, partial classes, or DI services
Color.Red, Color.FromHexColors.Red, Color.FromArgb, or resource colors
Application.Current.MainPage = ...Window.Page for intentional resets, or Shell/navigation abstractions for routine navigation
DependencyService.Get<T>()Constructor-injected services registered in MauiProgram.cs
MessagingCenterWeakReferenceMessenger, events, observable state, or explicit domain services
ExportRenderer / CustomRendererHandler mapper customization or ViewHandler<TVirtualView,TPlatformView>

DependencyService to DI

  1. Move the cross-platform contract to shared code:

``csharp public interface IClipboardAuditService { Task TrackCopyAsync(string source, CancellationToken cancellationToken = default); } ``

  1. Implement each platform in Platforms/<Platform>/ or target-specific files.
  2. Register the implementation in MauiProgram.cs with AddSingleton,

AddScoped, or AddTransient based on lifetime needs.

  1. Inject the service into view models or services. Avoid service locator calls

from pages unless the app already uses that pattern and you are containing migration risk.

MessagingCenter Replacement

Choose the smallest explicit communication pattern:

Existing useReplacement
View model updates a bound pageObservable properties and binding
Domain event across featuresWeakReferenceMessenger or an app event aggregator
One service asks another to workInject the target service and call a method
Navigation triggerNavigation service or Shell route call
Platform callbackPlatform service event or IObservable<T> exposed through DI

Do not migrate MessagingCenter by adding global static events everywhere. Document message names, payload types, sender/receiver lifetimes, and threading before replacing them.

Renderer to Handler Planning

Audit each renderer and classify it before writing code:

Renderer shapeMAUI migration
Changes one native property on an existing MAUI controlHandler.Mapper.AppendToMapping scoped to a subclass or named mapping
Needs a cross-platform custom control with bindable propertiesCustom handler with PropertyMapper and optional CommandMapper
Subscribes to native eventsHandler ConnectHandler/DisconnectHandler with explicit unsubscribe cleanup
Calls camera, health, maps, payment, or other SDK APIsPlatform service or slim binding; do not hide SDK workflow in a visual handler
Uses Xamarin.Forms effects only for stylingPrefer styles, visual states, or a handler mapper

Platform Capability Parity

For each target platform, record:

  • required permissions, entitlements, manifests, Info.plist keys, and app

capabilities;

  • Essentials API coverage and behavioral differences;
  • native SDK availability and version requirements;
  • background tasks, push/deep link, secure storage, file picker, and biometric

differences;

  • UI parity risks such as safe areas, keyboard/soft input, gestures, and desktop

pointer behavior.

Cross-Skill Routing

  • Use maui-current-apis for version-specific MAUI API replacements.
  • Use maui-custom-handlers for handler mapper/custom handler implementation.
  • Use maui-platform-invoke for non-visual platform services, partial classes,

permissions, and lifecycle hooks.

  • Use android-slim-bindings or ios-slim-bindings when a native SDK needs a

maintainable binding surface.

  • Use maui-accessibility and maui-performance for migrated UI risk areas.

Validation Checklist

  • The migration plan starts from an audited Xamarin.Forms solution, not guesses.
  • New code targets MAUI namespaces and current APIs.
  • Platform capabilities and permissions are mapped for every retained platform.
  • Renderers/effects are classified before migration.
  • DependencyService and MessagingCenter replacements have explicit lifetimes.
  • Each migrated slice builds and runs on at least one intended platform.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
224
Repository forks
35
7-day trend score
32

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dotnet/maui-labs/xamarin-forms-migration/badge)](https://verified-skill.com/skills/dotnet/maui-labs/xamarin-forms-migration)

Something wrong with this skill or its page? Tell us.