Xamarin.Forms has been around for a long time and has played a critical role in cross-platform application development. However, all good things must come to an end, which is what will happen to Xamarin.Forms as it is replaced by .NET MAUI (Multi-platform App UI) later this year. Fortunately, however, .NET MAUI has some great advantages to offer, meaning that developers will be able to be even more successful in their projects.
The History of Xamarin.Forms
The current form of Xamarin was founded back in 2011 as a solution that would enable the development of cross-platform applications on iOS, Android and Windows, based on .NET and C#. Xamarin development was all based on the same language, allowing code to be shared across all supported platforms. While the user interface (UI) of each platform wasn’t initially reusable, the solution came forward in 2014 under the name of Xamarin.Forms.
Xamarin.Forms delivered an abstraction layer above the various platforms’ UI concepts. This meant that developers could declare a button using C# and XAML, and Xamarin.Forms would know how to render that on iOS and then on Android. With Xamarin.Forms in place, developers were able to reuse most of their code across all platforms.
In 2016, shortly before the Xamarin Evolve conference, it was announced that Microsoft had acquired Xamarin. The acquisition was a huge step forward but left many unsure as to how the platform would change. Microsoft promised the name would remain the same, and tools were seamlessly incorporated into the Microsoft ecosystem. The result was that the Xamarin code became open source and free for anyone to use under the MIT license.
The Next Step for Xamarin.Forms
On the first day of Microsoft’s Build 2020 conference last year, Microsoft announced the next step in the evolution of Xamarin.Forms. This came as part of its journey to a single .NET, with the aim to create a framework with all the tools developers need to create amazing software for all platforms. .NET Multi-platform App UI, otherwise known as MAUI, was set to replace Xamarin.Forms.
The .NET MAUI framework will allow developers to create native user interfaces for both desktop and mobile with a single code base and a single project. What’s more, .NET MAUI will also support the MVU (Model View Update) design pattern, which encourages code-first development that rapidly updates the UI. With this development, Microsoft has created a new unified way to build cross-platform native front ends from a single code base with MVU allowing UI code and logic to be written in C#.
While there is much anticipation for .NET MAUI, it will not be available until the release of .NET 6, scheduled for November 2021. In the meantime, Xamarin.Forms will continue to evolve and improve with versions 4.7 and 4.8. Then, once .NET MAUI is with us, support will continue for Xamarin.Forms for 12 months. So, while it will be sad to lose the Xamarin name, we have time to adapt to the changes. And, more importantly, we have an opportunity to adopt similar characteristics to Xamarin.Forms but greater features.
Key Features of .NET MAUI
As we’ve discussed, .NET MAUI will enable the development of native user interfaces for desktop and mobile with a single code in single projects. The platform promises to deliver several benefits thanks to its key features:
- Single Project Structure – single source for multiple platforms with single-click deployment. Images, fonts and code can be added, with automatic native hooks.
- Slim Renderers – the existing renderers will be reengineered and built from the ground up to make them even more powerful.
- Visual Studio Code Support – .NET MAUI will support the Visual Studio Code (VS Code).
- Multiple Design Patterns Support – as well as supporting Model-View-ViewModel (MVVM) and XAML, NET. MAUI will support the MVU and Blazer development patterns.
The Future for Xamarin
While it is clear that we are going to have to say goodbye to the name, the future looks bright for the evolution of Xamarin.Forms into .NET MAUI. It was expected that Microsoft would eventually change the name and, while it may be sad for some, it shows that the Xamarin technology is here to stay. In the future, Xamarin is not only going to be backed by Microsoft, but it is going to be fully incorporated into the .NET ecosystem.
.NET MAUI promises to deliver many benefits. First and foremost, there will be no more frustration from working with multiple projects targeting multiple platforms. The new architecture will change the relationship between the framework and the target platform, making it more efficient and simplifying customisation. What’s more, as .NET MAUI embraces Android, iOS, macOS and Windows, apps can scale beyond mobile and tablets into fully-fledged desktop applications.
Ultimately, when it comes to the evolution of Xamarin.Forms, nothing is being taken away. Everything that is in Xamarin.Forms will be available in .NET MAUI. However, we are gaining an extension from mobile to desktop scenarios with UI controls rebuilt from the ground up. It’s hard not to be excited by the new release as it promises to further simplify and streamline development while expanding on performance.
In summary, here is a brief explanation of the past, present and future of Xamarin.Forms:
- Past – Xamarin was founded in 2011 as a solution to enable the development of cross-platform applications on iOS, Android and Windows, based on .NET and C#. In 2014, Xamarin.Forms was added to the framework, enabling the UI to also be reused cross-platform.
- Present – Microsoft acquired Xamarin in 2016, incorporated its tools into the Microsoft ecosystem and made the code open-source. At the Microsoft Build 2020 conference, Microsoft announced the planned evolution to the .NET Multi-platform App UI (MAUI) framework.
- Future – .NET MAUI will be released along with .NET 6 scheduled for November 2021. It will replace Xamarin.Forms and deliver single project structure, slim renderers, Visual Studio code support and multiple design patterns support.