Part 2: Things to Consider When Planning Your Migration from Xamarin.Forms to .NET MAUI

What steps should you take when preparing to migrate your app from Xamarin.Forms to .NET MAUI? This list will help you think it through.


This content originally appeared on Telerik Blogs and was authored by Rossitza Fakalieva

What steps should you take when preparing to migrate your app from Xamarin.Forms to .NET MAUI? This list will help you think it through.

In the previous post, we reviewed the pros and cons of migrating our code from Xamarin.Forms to .NET MAUI. In this post we will highlight the major points of planning the migration.

In short, these are the things that are good to consider before starting:

  • Prepare your environment
  • Review DataModels
  • Choose a navigation pattern
  • Analyze third-party libraries
  • Benefit from Azure support
  • Take a minute to think about Windows UI and the desktop experience
  • Leave customization until the end
  • Stay tuned for the next posts where we will review more API changes and some manual work you need to do in renaming APIs

1. Install VS 2022 and Set up Your .NET MAUI Environment

This is a basic but very important step for our process. Installing the latest version of VS 2022 or VS for Mac should set up most all that you need to start your development. Still, for Mac there are some additional requirements, such as:

Note: Full steps can be found on Microsoft’s documentation site—check it for latest updates.

Once you are ready, you will be able to start with a basic .NET MAUI app—which is a great starting point. Create one and have a look at it as we will use it as reference during the migration.

Another important tool that we will use during the migration is .NET Update Assistant. You can now download it too from VS MarketPlace, but I still recommend it to use it via cmd as the extension has some limitations. You can install it simply with the following command:

dotnet tool install -g --add-source "https://api.nuget.org/v3/index.json" --ignore-failed-sources upgrade-assistant

2. Review Data Models and Patterns of Your Existing App

Now is a good time to review how the code separation is handled in your app and to decide whether to migrate it directly or consider changing it as .NET MAUI support improved MVVM support and a new MVU pattern is also added.

If you already using MVVM in your app, it is more natural to stay on it. It’s a great and widely used pattern. But if this is the case, there are some other important notes to consider if you use one of the popular MVVM helper libraries:

MVVM cross is popular for Xamarin, but currently not supported with .NET MAUI. As an alternative, you can rely purely on the built-in MVVM MAUI support or consider using MVVM Community toolkit.

3. Choose a Navigation Pattern

.NET MAUI supports great shell navigation and every sample .NET MAUI app contains a template ready to start with. If you do not use shell navigation, consider this change as a step in the migration plan: .NET MAUI Shell navigation - .NET MAUI | Microsoft Learn. Using basic page navigation is also an option: FlyoutPage, TabbedPage and NavigationPage.

4. Check Whether Your Third-Party Libraries Support .NET MAUI

This is an important step in preparation. Check this in advance and find alternatives of your APIs if not.

One such library is Progress Telerik UI for Xamarin—don’t worry, we’ve got you covered. You can replace it safely with Telerik UI for .NET MAUI. (Download it here!)

5. Azure Support

Where is your data service published? What kind of login authentication do you have? Take a step to consider the usage of Azure for all of these if you still haven’t.

If your mobile already uses Azure, an important note is that Microsoft.WindowsAzure.MobileServices are now rebranded as Microsoft Datasync.Client. Read a full explanation and sample in Microsoft docs: Build a .NET MAUI app with Azure Mobile Apps | Microsoft Learn—or in one of our next posts where we will integrate Telerik .NET MAUI app and Azure mobile .

So plan migration of Azure references as a separate step and read resources before that.

6. Take a Minute to Consider the Future of Windows Support

With .NET MAUI Windows, support is focused more on the desktop side, so now is time to consider whether you need to polish the UI of the Windows version to be a little better for your desktop users. If Windows is not a priority for you, you can still leave this part for debugging and easy development purposes.

7. Have You Used Custom Renderers to Customize the Native Controls?

Consider their migration to .NET MAUI handlers by preparing yourself with handlers architecture and following our series where we will describe the options here—should we use the handlers architecture or migrate the renderers directly?

8. Follow Us for More Guidance

There are some API changes when migrating from Xamarin.Forms to .NET MAUI. We will review them in the next two posts explaining how we managed to migrate our ERP app.


This content originally appeared on Telerik Blogs and was authored by Rossitza Fakalieva


Print Share Comment Cite Upload Translate Updates
APA

Rossitza Fakalieva | Sciencx (2023-04-05T07:33:03+00:00) Part 2: Things to Consider When Planning Your Migration from Xamarin.Forms to .NET MAUI. Retrieved from https://www.scien.cx/2023/04/05/part-2-things-to-consider-when-planning-your-migration-from-xamarin-forms-to-net-maui/

MLA
" » Part 2: Things to Consider When Planning Your Migration from Xamarin.Forms to .NET MAUI." Rossitza Fakalieva | Sciencx - Wednesday April 5, 2023, https://www.scien.cx/2023/04/05/part-2-things-to-consider-when-planning-your-migration-from-xamarin-forms-to-net-maui/
HARVARD
Rossitza Fakalieva | Sciencx Wednesday April 5, 2023 » Part 2: Things to Consider When Planning Your Migration from Xamarin.Forms to .NET MAUI., viewed ,<https://www.scien.cx/2023/04/05/part-2-things-to-consider-when-planning-your-migration-from-xamarin-forms-to-net-maui/>
VANCOUVER
Rossitza Fakalieva | Sciencx - » Part 2: Things to Consider When Planning Your Migration from Xamarin.Forms to .NET MAUI. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/04/05/part-2-things-to-consider-when-planning-your-migration-from-xamarin-forms-to-net-maui/
CHICAGO
" » Part 2: Things to Consider When Planning Your Migration from Xamarin.Forms to .NET MAUI." Rossitza Fakalieva | Sciencx - Accessed . https://www.scien.cx/2023/04/05/part-2-things-to-consider-when-planning-your-migration-from-xamarin-forms-to-net-maui/
IEEE
" » Part 2: Things to Consider When Planning Your Migration from Xamarin.Forms to .NET MAUI." Rossitza Fakalieva | Sciencx [Online]. Available: https://www.scien.cx/2023/04/05/part-2-things-to-consider-when-planning-your-migration-from-xamarin-forms-to-net-maui/. [Accessed: ]
rf:citation
» Part 2: Things to Consider When Planning Your Migration from Xamarin.Forms to .NET MAUI | Rossitza Fakalieva | Sciencx | https://www.scien.cx/2023/04/05/part-2-things-to-consider-when-planning-your-migration-from-xamarin-forms-to-net-maui/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.