.NET MAUI

.NET MAUI

Episode Fifteen

.NET MAUI or .NET Multi-platform App UI enables developers to build cross-platform desktop and mobile apps using the latest technologies.

Intro

I'm Peter and this is the RoguePlanetoid Podcast where you will find insights about Microsoft or related platforms and technology, along with so much more whether you are beginner or an experienced professional or just interested in technology. Keep Current, Keep Coding!

Welcome

Welcome to episode fifteen of the RoguePlanetoid Podcast about .NET MAUI. .NET MAUI or .NET Multi-platform App UI enables developers to build cross-platform desktop and mobile apps using the latest technologies. .NET MAUI allows developers to build native applications for desktop on Windows using WinUI 3, macOS using Mac Catalyst and for mobile on iOS and Android abstracted with one common framework built on .NET. NET MAUI can also take advantage of native APIs to enable platform specific functionality, it also abstracts the user interface of applications with XAML that is decoupled from events, business objects and other code. XAML allows developers to create layouts for their applications with controls styled as needed or with rotations, animations, and other effects to help applications stand out or blend in with native platform applications. To learn more about using XAML on other platforms such as Windows Presentation Foundation and Windows App SDK then you can listen to the previous episode of the RoguePlanetoid Podcast about XAML wherever you listen to your podcasts, or you can check out the link in the show notes.

Xamarin

.NET MAUI originated with Xamarin back in 2011 which itself was an offshoot of Mono which was first released in 2004. Mono started since Microsoft had published the underling infrastructure of .NET Framework during development in 2000 as an open-standard, this created the potential of an open-source version of the platform which resulted in Mono. Mono would be adopted by a new company in 2011 called Xamarin which would continue to use it to create a platform for building applications for Android and iOS on Mobile along with macOS and Windows using Universal Windows Platform. Xamarin Forms was then developed which allowed controls to be mapped to the native controls on mobile platforms such as Android and iOS and used XAML. In 2016 Microsoft acquired Xamarin which not only brought the existing Mono platform within the company, but that same year .NET Core 1.0 was released which would pave the way for the modern open-source version of .NET we have today. It would be in 2022 when Microsoft announced .NET MAUI, an evolution of Xamarin Forms, however it is destined to replace it, so if you want to find out more about migrating from Xamarin then you can visit xamarin.com or check out the link in the show notes.

.NET MAUI

.NET MAUI is an open-source cross-platform framework that allows developers to write a .NET MAUI App with C# and XAML in a single project supporting all target platforms to build applications that look and feel like applications native to those target platforms, by installing the .NET Multi-platform App UI Development workload for Visual Studio. Developers can create applications with .NET MAUI that unify mobile and desktop application development into a single API for a write-once and run-anywhere experience for developers along with providing access to aspects of each native platform. .NET MAUI uses platform specific frameworks that take advantage of a common .NET Base Class Library for creating applications using .NET for Android, .NET for iOS and .NET for Mac which still take advantage of the Mono Runtime from Xamarin and for Windows with WinUI 3 using the .NET Core Common Language Runtime. Developers can build applications for Windows and Android using Windows or for developers with access to a Mac can build for macOS and iOS.

.NET MAUI does not support a Design View for XAML, but that doesn't hold back any creativity when designing applications as thanks to Hot Reload you can make changes to an application while it is running and then see those changes allowing you to shape an application in real time without even needing to save any changes. If something doesn't work you can just put it back, or if it does then you can save it and go on to the next change until you are happy with the look and feel of your application, and thanks to the decoupled nature of XAML you can refine the user interface of your application all without affecting any implementation in code. If you want to get started or find out more about .NET MAUI, then visit dot.net/maui or check out the link in the show notes.

Blazor Hybrid

.NET MAUI allows developers to create native client applications that reuse Blazor components from web applications in native mobile and desktop applications with Blazor Hybrid. Blazor allows developers to create beautiful user experiences with a flexible and reusable component model based on HTML, CSS, and C#. .NET MAUI uses Blazor components natively so there is no WebAssembly needed and Blazor components are rendered in the latest Chromium-based Edge WebView2 control. Blazor Components used with Blazor Hybrid in .NET MAUI can take advantage of non-web-based platform features such as notifications, file system access and more. Blazor Hybrid also allows you to mix native UI components in .NET MAUI with Blazor components to create the experiences you need in an application. If you want to find out more about Blazor then you listen to Episode Six of the RoguePlanetoid Podcast wherever you listen to your podcasts or you can visit blazor.net or you can check out the links in the show notes.

Community Toolkit

.NET MAUI has great community support with many packages that can be used to help accelerate application development including the .NET MAUI Community Toolkit which is a collection of common elements that tend to be replicated across multiple applications, along with demonstrating common developer tasks when building applications with .NET MAUI. Developers can not only use the .NET MAUI Community Toolkit themselves but can also contribute to it and there's a chance that some features that are contributed may eventually make their way into the official .NET MAUI library itself. Developers can suggest new features for the .NET MAUI Community Toolkit by creating a proposal where any maintainers can then champion it, then if approved developers can then create a Pull Request for the implementation along with documentation to then be merged to become part of the .NET MAUI Community Toolkit. If you want to find out more about the .NET MAUI Community Toolkit or contribute yourself then you can visit github.com/communitytoolkit/maui or check out the link in the show notes.

Conclusion

.NET MAUI enables developers to target both desktop for Windows or Mac and mobile for iOS or Android from a single codebase using C# and XAML. .NET MAUI does use a different flavour of XAML compared to Windows Presentation Foundation or Windows App SDK, so there are many significant differences including names of controls, what controls are supported and names of properties on any supported controls, so .NET MAUI may present a learning curve for developers who have used XAML before on other platforms.

I recently used .NET MAUI for the very first time when putting together my talk, Take a Note of XAML with .NET 8, where I created the same application in Windows Presentation Foundation and Windows App SDK which were pretty much identical, along with creating the same application in .NET MAUI. I did find the differences in the XAML in .NET MAUI meant I had to change what I used to get close to a similar looking application. However, it great to see how much the platform has evolved since Xamarin as had used that before, but there were many features missing back then that are now present within .NET MAUI which was great to see.

Developers will find that in .NET MAUI support for the same base class libraries in the latest version of .NET means any business logic is fully portable between other frameworks using XAML such as Windows Presentation Foundation and Windows App SDK with the only major difference the user interface layer. Developers can add platform specific functionality for each target platform should they wish to with .NET MAUI, or developers can maintain the same functionality across all platforms. If you want to look at the source code for .NET MAUI, then you can visit github.com/dotnet/maui or check out the link in the show notes.

Outro

Thanks for listening to the RoguePlanetoid Podcast where each episode you will find insights about Microsoft or related platforms and technology, along with so much more wherever you listen to your podcasts or at rogueplanetoid.com/podcasts for the RoguePlanetoid Podcast whether you are a beginner or an experienced professional or just interested in technology. Keep Current, Keep Coding!

RoguePlanetoid Podcast is a production of cluarantonn.com

Hosted, Written, Produced and Edited by Peter Bull

Music based on Like a Tiger by Jo Wandrini

Production Company Name by Granny Robertson