Telerik blogs

Welcome to the Sands of MAUI—newsletter-style issues dedicated to bringing together the latest .NET MAUI content relevant to developers.

A particle of sand—tiny and innocuous. But put a lot of sand particles together and we have something big—a force to reckon with. It is the smallest grains of sand that often add up to form massive beaches, dunes and deserts.

.NET developers are excited with the reality of .NET Multi-platform App UI (.NET MAUI)—the evolution of modern .NET cross-platform developer technology stack. With stable tooling and a rich ecosystem, .NET MAUI empowers developers to build native cross-platform apps for mobile/desktop from single shared codebase, while inviting web technologies in the mix.

While it may take a long flight to reach the sands of MAUI island, developer excitement around .NET MAUI is quite palpable with all the created content. Like the grains of sand, every piece of news/article/documentation/video/tutorial/livestream contributes toward developer experiences in .NET MAUI and we grow a community/ecosystem willing to learn and help.

Sands of MAUI is a humble attempt to collect all the .NET MAUI awesomeness in one place. Here’s what is noteworthy for the week of February 26, 2024:

Hello .NET 9

It’s the start of a new year and the next big milestone for .NET is already cooking. Following the successful launch of .NET 8 a few months back, .NET is back on its annual release cycle—say hello to .NET 9 with Preview 1 now out. Along with the first bits for .NET 9, the .NET team also laid out broad plans for what’s ahead—the vision for .NET 9.

Set to be released at .NET Conf in November 2024, work is underway toward the next big .NET release. The most important focus areas for .NET 9 are cloud-native and intelligent app development. Developers can expect significant investments in performance, productivity and security, as well as advancements across the .NET platform. Tooling will get better with Visual Studio and Visual Studio Code with the C# Dev Kit, and cloud deployments will get easier using Azure services.

Microsoft will continue to work with developers looking for ways to use C# skills to build next generation of intelligent apps, and to rapidly invest in AI. With .NET 9 Preview bits available now, developers can start tinkering with what’s next—.NET 9 promises great things for the ecosystem.

.NET MAUI Release

.NET MAUI is built to enable .NET developers to create cross-platform apps for Android, iOS, macOS and Windows, with deep native integrations, platform-native UI and hybrid experiences that extend the reach of Blazor/JS web UI technologies. With increased stability and a rich ecosystem, developers are finding more enticement to build cross-platform apps with .NET MAUI. As the .NET 9 comes up on the horizon, cross-platform stack is getting some love as David Ortinau pointed out—there are fresh new bits out for .NET MAUI.

While there is a service release out to support .NET MAUI on .NET 8, all eyes are on the future—.NET MAUI bits now run on .NET 9 Preview 1. The team is continuing work on core fundamentals of the .NET MAUI SDK to improve overall stability—this includes expanding test coverage, end-to-end scenario testing and bug fixing. The .NET MAUI theme for the .NET 9 release is improved product quality across layout, control features, and reliability of tooling experiences such as setup, build, deploy, hot reload, debug and diagnostics. There are interesting work items under consideration including Swift Interop, custom cursors and more—upwards and onwards with .NET MAUI on .NET 9.

Community Toolkit Behaviors

Cross-platform app development is not easy and developers need all the support—the .NET MAUI Community Toolkit is here to boost productivity. The .NET MAUI Community Toolkit is a curated collection of reusable elements for application development with .NET MAUI, thoughtfully created/maintained by the developer community. Developers should not reinvent the wheel on common UI needs and Leomaris Reyes wrote up an article—exploring four behaviors from the .NET MAUI Community Toolkit.

The .NET MAUI Community Toolkit encompasses a range of elements such as animations, converters and behaviors—all designed to simplify common developer tasks when building iOS, Android, macOS and WinUI applications using .NET MAUI. Behaviors enable the addition of specific functionalities to UI elements. These modular features enhance functionality toward better UX.

Leomaris showcases four wonderful behaviors from the .NET MAUI Community Toolkit—EmailValidator, Masked, IconTintColor and Animations. Starting from basic configuration, Leomaris walks through how developers can hook up the behaviors to UI elements, explore properties and see the resulting UI light up wonderful user experiences with little code—developer productivity for the win.

Responsive Layouts

With .NET MAUI, developers can target mobile and desktop form factors from a single shared codebase. While the codebase is shared, user experiences should not be the same—.NET MAUI developers are encouraged to cater to mobile and desktop experiences based on the device form factors. Matt Goldman is no stranger to building first-class mobile/desktop experiences with .NET MAUI and wrote up an interesting article—responsive design with orientation changes in .NET MAUI.

A common UX paradigm for apps is to offer different layouts on mobile and desktop—a list of items with a secondary detail page on mobile and a two-pane list/detail layout for desktop. On tablets offering increased real estate, Matt wanted a responsive layout with portrait mode behaving like mobile, and landscape mode mimicking desktop UX. Things get a little challenging on iPads with support for multitasking using split view/slide-over—orientation of the device doesn’t necessarily reflect the orientation of the app.

Matt explored a few potential workarounds before settling on a reliable solution. The SizeChanged event is a dependable way of knowing page resizing events. Matt showcases how to leverage SizeChanged event handlers to programmatically trigger visual state changes, and update UI layout accordingly—lots of inspiration for .NET MAUI developers who want to carefully fine tune the UX across devices and orientation changes.

Xamarin to .NET MAUI

.NET MAUI is the evolution of modern .NET cross-platform development stack, allowing developers to reach mobile and desktop form factors from single shared codebase. The present reality for many apps, however, may be Xamarin or Xamarin.Forms. A migration strategy is needed to move things forward. Lance McCarthy has been busy trying to migrate a sample Telerik app and joined an aging developer to share experiences on the .NET Dev Show—moving CRM app code from Xamarin.Forms to .NET MAUI.

May 2024 is when official support runs out for Xamarin and Xamarin.Forms—now would be a great time to start the migration to .NET MAUI. The Telerik Art Gallery CRM app is a wonderful showcase app available in iOS/Android/Windows App Stores—written with Xamarin.Forms and source code up on GitHub. The move forward may be a great time to inspect the need for certain app features and plot migration of backend services with dependencies on older runtimes.

Thankfully, much of the C# and XAML code from Xamarin.Forms should move forward seamlessly into .NET MAUI, albeit with a few changes. Lance took the time to show off the tweaks toward maximum code reuse. The real benefits of moving to .NET MAUI are the truly shared single project, reusable assets, dependency injection and increased platform reach. Lance is scheduled for future episodes on the .NET Dev Show—should be a great series on migration tactics to move a real-world app from Xamarin to .NET MAUI.

That’s it for now.

We’ll see you next week with more awesome content relevant to .NET MAUI.

Cheers, developers!


SamBasu
About the Author

Sam Basu

Sam Basu is a technologist, author, speaker, Microsoft MVP, gadget-lover and Progress Developer Advocate for Telerik products. With a long developer background, he now spends much of his time advocating modern web/mobile/cloud development platforms on Microsoft/Telerik technology stacks. His spare times call for travel, fast cars, cricket and culinary adventures with the family. You can find him on the internet.

Related Posts

Comments

Comments are disabled in preview mode.