MRK.MAUI.RefactorKit is a Roslyn-based analyzer and code fix provider that helps automate the migration from Xamarin.Forms to .NET MAUI by converting legacy code in the new syntax of MAUI.
- 🔍 Analyzes Xamarin-style properties.
- 🔧 Automatically refactors them into
ObservableProperty
fields (CommunityToolkit.Mvvm). - 📦 Packaged as a NuGet analyzer — no manual execution required.
- 🧠 Designed for clean, idiomatic .NET MAUI development.
Add the NuGet package to your MAUI project:
dotnet add package MRK.MAUI.RefactorKit
Or via Visual Studio NuGet Manager.
Simply install the package and build your project.
The analyzer will:
- Detect Xamarin-style backing fields and properties.
- Suggest fixes via lightbulb (Ctrl + .) or auto-fix.
- Transform to the ObservableProperty attribute-based syntax.
- Transform the DelegateCommand from MVVM to the new
RelayCommand
syntax. - Transform the Command to the new
RelayCommand
syntax.
You can find examples of the refactoring in the README.md file of the MRK.MAUI.RefactorKit.Package
project.
- .NET MAUI project
- CommunityToolkit.Mvvm installed
If you have any questions, feedback or a bug to report, feel free to open an issue or contact me direct in my mail 😊