Migrate from Xamarin.Forms to .NET MAUI
- 6 minutes to read
.NET MAUI is an evolution of the Xamarin.Forms platform. Most DevExpress components for Xamarin.Forms have counterparts in .NET MAUI. If your Xamarin.Forms application is based on DevExpress components, you can follow the steps in this article to create a similar .NET MAUI application.
To migrate from the DevExpress Xamarin.Forms Controls to DevExpress .NET MAUI Controls, follow the steps below:
- Convert the projects from .NET Framework to .NET SDK Style
- Update NuGet packages
- Update code namespaces
- Address breaking API changes
See the following Microsoft topics for more information: Migrate your app from Xamarin.Forms and Xamarin.Forms Support Policy.
#Step 1: Create a New Project
Refer to the following Microsoft topic for information on how to create a .NET MAUI project: Migrating from Xamarin.Forms - Create a New Project.
#Step 2: Update DevExpress NuGet Package References
The following table lists DevExpress Xamarin.Forms NuGet packages and their equivalents in DevExpress .NET MAUI:
DevExpress Xamarin. |
DevExpress .NET MAUI Controls Nu |
---|---|
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
#Step 3: Update Code Namespaces
#Step 3.1: Update Framework Namespaces
Refer to the following Microsoft topic for information on how to update framework namespaces: Migrating from Xamarin.Forms - Source Code Updates.
#Step 3.2: Update DevExpress Namespaces
#XAML Namespaces
The following table lists DevExpress Xamarin.Forms XAML namespaces and their equivalents in DevExpress .NET MAUI:
DevExpress Xamarin. |
DevExpress .NET MAUI Controls Namespace |
---|---|
http://schemas. |
clr-namespace:DevExpress. |
http://schemas. |
clr-namespace:DevExpress. |
http://schemas. |
clr-namespace:DevExpress. |
http://schemas. |
clr-namespace:DevExpress. |
http://schemas. |
clr-namespace:DevExpress. |
http://schemas. |
clr-namespace:DevExpress. |
#Code-Behind Namespaces
The following table lists DevExpress Xamarin.Forms namespaces and their equivalents in DevExpress .NET MAUI:
DevExpress Xamarin. |
DevExpress .NET MAUI Controls Namespace |
---|---|
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
DevExpress. |
#Step 3.3: Replace Initializers with the UseDevExpress Method
If you use DevExpress Xamarin.Forms Controls, your code calls the Initializer.Init()
method for each DevExpress namespace you reference in the application:
using System.ComponentModel;
using Xamarin.Forms;
namespace DataGrid_Columns {
public partial class MainPage : ContentPage {
public MainPage() {
DevExpress.XamarinForms.DataGrid.Initializer.Init();
DevExpress.XamarinForms.Charts.Initializer.Init();
// other DevExpress Xamarin.Forms Control Initializers
InitializeComponent();
}
}
}
If you migrate to DevExpress .NET MAUI Controls, replace those method calls with a single call to the UseDevExpress(MauiAppBuilder, Boolean) method. It registers all DevExpress MAUI controls:
using DevExpress.Maui;
namespace DataForm_GettingStarted;
public static class MauiProgram {
public static MauiApp CreateMauiApp() {
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseDevExpress()
.ConfigureFonts(fonts => {
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
});
return builder.Build();
}
}
You can also pass true
to the UseDevExpress() method as a parameter to localize DevExpress .NET MAUI Controls. Refer to the following topic for more information: Localization.
#Step 3.4: Update the DevExpress Xamarin.Forms Types to Their .NET MAUI Equivalents
This section lists DevExpress Xamarin.Forms types that we renamed in DevExpress .NET MAUI. Rename the types in your applications and review related breaking API changes listed in footnotes.
#Navigation
The table below lists types available in the DevExpress.XamarinForms.Navigation namespace and their .NET MAUI counterparts. Note that the types from the DevExpress.XamarinForms.Navigation namespace now belong to the DevExpress.Maui.Controls namespace.
#Related Breaking API Changes
- T1085745 - Navigation controls for .NET MAUI are no longer supported - The DevExpress Mobile UI for .NET MAUI suite does not include the TabPage, DrawerPage, and DrawerView components available in our suite for Xamarin.Forms.
- T1125434 - Controls - API Changes
- T1124204 - Changes on the Appearance Classes
#Popup
The table below lists types available in the DevExpress.XamarinForms.Popup namespace and their .NET MAUI counterparts.
Note
All types from the DevExpress.
#Related Breaking API Change
#Data Editors
The table below lists types available in the DevExpress.XamarinForms.Editors namespace and their .NET MAUI counterparts.
Note
Certain types from the DevExpress.
#Related Breaking API Changes
- T1124204 - Changes on the Appearance Classes
- T1120574 - DataGridView and DXCollectionView - API Changes
- T1120789 - Editors - API Changes
- T1125921 - Localization Mechanism Changes
#Data Grid
The table below lists types available in the DevExpress.XamarinForms.DataGrid namespace and their .NET MAUI counterparts.
#Related Breaking API Changes
- T1124204 - Changes on the Appearance Classes
- T1120574 - DataGridView and DXCollectionView - API Changes
- T1125921 - Localization Mechanism Changes
#Charts
The table below lists types available in the DevExpress.XamarinForms.Charts namespace and their .NET MAUI counterparts.
Xamarin. |
.NET MAUI Type |
---|---|
Chart |
Chart |
#Related Breaking API Change
#Scheduler
The table below lists types available in the DevExpress.XamarinForms.Scheduler namespace and their .NET MAUI counterparts.
Xamarin. |
.NET MAUI Type |
---|---|
All |
All |
Appointment |
Appointment |
Cell |
Scheduler |
Day |
Day |
Day |
Day |
Header |
Header |
Item |
Appearance |
Scheduler |
Scheduler |
Month |
Month |
Month |
Month |
Text |
Members of this class and its descendants are now stored in the Appearance class of the Scheduler elements.[2] |
Time |
Time |
Time |
Time |
Time |
Time |
#Related Breaking API Changes
#Step 4: Address Breaking API Changes
To migrate your application from the DevExpress Xamarin.Forms Controls to DevExpress .NET MAUI Controls, you need to address the following breaking API changes:
- T1085745 - The TabPage, DrawerPage, and DrawerView Navigation Controls for .NET MAUI have been removed
- T1113074 - The DataFormDisplayOptions.IsReadOnly attribute is obsolete
- T1125921 - Localization Mechanism Changes
- T1124204 - Changes on the Appearance Classes
- T1120789 - Editors - API Changes
- T1125434 - Controls - API Changes
- T1120574 - DataGridView and DXCollectionView - API Changes
- T1127009 - ChartViewBase.Theme Property Removed
-
Breaking Change: T1125434 - Controls - API Changes
-
Breaking Change: T1124204 - Changes on the Appearance Classes
-
Breaking Change: T1120574 - DataGridView and DXCollectionView - API Changes
-
Breaking Change: T1125921 - Localization Mechanism Changes
-
Breaking Change: T1127009 - ChartViewBase.Theme Property Removed