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.Forms Controls NuGet Package | DevExpress .NET MAUI Controls NuGet Package |
---|---|
DevExpress.XamarinForms.Charts |
DevExpress.Maui.Charts |
DevExpress.XamarinForms.CollectionView |
DevExpress.Maui.CollectionView |
DevExpress.XamarinForms.Editors |
DevExpress.Maui.Editors |
DevExpress.XamarinForms.Grid |
DevExpress.Maui.DataGrid |
DevExpress.XamarinForms.Navigation |
DevExpress.Maui.Controls |
DevExpress.XamarinForms.Scheduler |
DevExpress.Maui.Scheduler |
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.Forms Controls Namespace | DevExpress .NET MAUI Controls Namespace |
---|---|
http://schemas.devexpress.com/xamarin/2014/forms/charts |
clr-namespace:DevExpress.Maui.Charts;assembly=DevExpress.Maui.Charts |
http://schemas.devexpress.com/xamarin/2014/forms/collectionview |
clr-namespace:DevExpress.Maui.CollectionView;assembly=DevExpress.Maui.CollectionView |
http://schemas.devexpress.com/xamarin/2014/forms/editors |
clr-namespace:DevExpress.Maui.Editors;assembly=DevExpress.Maui.Editors |
http://schemas.devexpress.com/xamarin/2014/forms/datagrid |
clr-namespace:DevExpress.Maui.DataGrid;assembly=DevExpress.Maui.DataGrid |
http://schemas.devexpress.com/xamarin/2014/forms/navigation |
clr-namespace:DevExpress.Maui.Controls;assembly=DevExpress.Maui.Controls |
http://schemas.devexpress.com/xamarin/2014/forms/scheduler |
clr-namespace:DevExpress.Maui.Scheduler;assembly=DevExpress.Maui.Scheduler |
Code-Behind Namespaces
The following table lists DevExpress Xamarin.Forms namespaces and their equivalents in DevExpress .NET MAUI:
DevExpress Xamarin.Forms Controls Namespace | DevExpress .NET MAUI Controls Namespace |
---|---|
DevExpress.XamarinForms.Charts |
DevExpress.Maui.Charts |
DevExpress.XamarinForms.CollectionView |
DevExpress.Maui.CollectionView |
DevExpress.XamarinForms.Editors |
DevExpress.Maui.Editors |
DevExpress.XamarinForms.Grid |
DevExpress.Maui.DataGrid |
DevExpress.XamarinForms.Navigation |
DevExpress.Maui.Controls |
DevExpress.XamarinForms.Scheduler |
DevExpress.Maui.Scheduler |
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.XamarinForms.Popup namespace now belong to the DevExpress.Maui.Controls namespace.
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.XamarinForms.Editors namespace now belong to the DevExpress.Maui.Controls namespace.
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.Forms Type | .NET MAUI Type |
---|---|
ChartBaseView | ChartBaseView[5] |
Related Breaking API Change
Scheduler
The table below lists types available in the DevExpress.XamarinForms.Scheduler namespace and their .NET MAUI counterparts.
Xamarin.Forms Type | .NET MAUI Type |
---|---|
AllDayAreaCellStyle | AllDayAreaCellAppearance[2] |
AppointmentStyle | AppointmentAppearance[2] |
CellStyle | SchedulerCellAppearance[2] |
DayViewCellStyle | DayViewCellAppearance[2] |
DayViewHeaderItemStyle | DayViewHeaderItemAppearance[2] |
HeaderItemStyle | HeaderItemAppearance[2] |
ItemStyle | AppearanceBase[2] |
SchedulerLocalizer | SchedulerLocalizer[4] |
MonthViewCellStyle | MonthViewCellAppearance[2] |
MonthViewHeaderItemStyle | MonthViewHeaderItemAppearance[2] |
TextStyle | Members of this class and its descendants are now stored in the Appearance class of the Scheduler elements.[2] |
TimeIndicatorStyle | TimeIndicatorAppearance[2] |
TimeRulerCellStyle | TimeRulerCellAppearance[2] |
TimeRulerHeaderStyle | TimeRulerHeaderAppearance[2] |
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