This content originally appeared on Telerik Blogs and was authored by Sam Basu
Welcome to the Sands of MAUI—newsletter-style issues dedicated to bringing together 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.
Most .NET developers are excited with .NET Multi-platform App UI (MAUI)—the evolution of modern .NET cross-platform developer experience. Going forward, developers should have much more confidence in the technology stack and tools as .NET MAUI empowers native cross-platform solutions on both mobile and desktop.
While it may take a long flight to reach the sands of MAUI island, developer excitement around .NET MAUI is quite palpable in all the shared content. Like the grains of sand, every piece of news/article/documentation/video/tutorial/livestream contributes toward developer knowledge 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 March 27, 2023:
.NET 8 Preview 2
The next chapter in the evolution of .NET is well on its way—.NET 8 is cooking and scheduled to be released in November 2023. Hot off the heels of the larger .NET 8 Preview 1 release, .NET 8 Preview 2 is now out. As David Ortinau pointed out, these are very early days, but much to look forward for .NET MAUI developers in .NET 8 Preview 2.
.NET 8 Preview 2 offers a short, but exciting array of new features mostly in the core .NET libraries—there are improvements in C# Attributes and Reflections. With .NET 8 Preview 2 support tested in Visual Studio 17.6 Preview 2, developers on the bleeding edge can try out .NET MAUI release 8.0.0-preview.2.7871.
The recommended platform versions to run the latest .NET MAUI for .NET 8 builds against are iOS/iPadOS/MacCatalyst 16.2, Android API 33 and Windows App SDK 1.2.221109.1. The focus for .NET MAUI in .NET 8 is SDK quality and some improvements in the latest preview release include device API changes, Shell updates and UI tweaks.
.NET MAUI BottomSheet
BottomSheets are UI surfaces containing supplementary content that are anchored to the bottom of mobile screens—a pretty common UX paradigm on iOS/Android. BottomSheets are often used to offer extra information/choices/interactions to users, and the UX of swiping up from bottom, dragging to larger size and dismissal is universally well accepted.
There is good news for developers wanting to implement BottomSheets in .NET MAUI apps, and Gerald Versluis produced a video to help—add a BottomSheet to .NET MAUI Apps with a wonderful Plugin.
Gerald starts out explaining the nuances of Bottomsheet UI and points developers to a BottomSheet plugin maintained by Paul Varache. Integrating the BottomSheet plugin is fairly straightforward—developers need to grab The49.Maui.BottomSheet NuGet package, initialize the Plugin in a MauiProgram.cs extension method and start using the BottomSheet UI inside .NET MAUI app pages. Gerald shows off a simple BottomSheet UI in action within a sample .NET MAUI app, explores the API and demonstrates BottomSheet detents in controlling the swipe behavior.
While early days mean there are some UI inconsistencies between iOS/Android, the promise of BottomSheets on mobile apps written in .NET MAUI is rather enticing.
Layout Behaviors
Modern mobile/desktop apps should exude easy UX and a lot of it comes down to UI. Developers have to build up the visual tree right for best possible UI, and container controls help—layouts are key to how visual elements are arranged. There has been some evolution in layouts between Xamarin.Forms and .NET MAUI, and Leomaris Reyes wrote up a wonderful article on this topic—Xamarin.Forms to .NET MAUI: How Layout Behavior Has Evolved.
Leomaris starts with the two most common layout containers used by Xamarin.Forms or .NET MAUI developers—Grid and StackLayout. Compared to Grid layout in Xamarin.Forms, it’s mandatory to declare both columns and rows explicitly in .NET MAUI. For StackLayouts, .NET MAUI developers are encouraged to utilize the newer VerticalStackLayout or HorizontalStackLayout for better performance.
There have also been changes to expansion values in StackLayout—how child elements grow/expand to fill up the available space has evolved in .NET MAUI. Developers need to use the Grid over RelativeLayout in .NET MAUI, and there are changes to how the ScrollView grows indefinitely inside container controls. Whether developers are migrating apps from Xamarin.Forms or starting to build .NET MAUI apps from scratch, understanding visual layouts helps in getting UI and UX right—thanks, Leomaris, for the pointers.
.NET MAUI Showcase
.NET MAUI is the evolution of cross-platform development with .NET, allowing developers to target mobile/desktop platforms from a single shared codebase. This is a big promise though, and developers would need all the ammunition that’s around to be successful with .NET MAUI. Javier Suárez is here to help celebrate the .NET MAUI ecosystem with Awesome .NET MAUI—a GitHub repo showcasing a curated list of .NET MAUI libraries and resources.
Javier is not only a key member of the .NET MAUI engineering team, but also one who understands the importance of a vibrant developer ecosystem toward the success of any development platform. Awesome .NET MAUI is a wonderful curated list of all the help available to .NET MAUI developers—sample apps, full-blown workshops, app templates, productivity tools, plugins and more.
The longest list, however, belongs to the most needed amongst .NET MAUI libraries—lots of UI components that help developers ship beautiful performant .NET MAUI apps faster. Cheers, Javier, for keeping the Awesome .NET MAUI repo updated—contributions are always welcome.
Accessibility in .NET MAUI
Accessibility means making it possible for a wide range people to access/interact with software/hardware to improve the quality of life—it is a basic human right. Accessibility not only improves software usability and UX, but it simply makes business sense—it broadens the user base making apps more accessible across human differences.
For .NET MAUI developers, there is quite a bit of help already built into the framework—however, accessibility is a journey. Shane Neuville and Rachel Kang want to help out by increasing awareness and have been hosting .NET MAUI Accessibility Office Hours.
For the latest Accessibility Office Hour for March, Shane and Rachel started where they left off last month—sharing lessons learned and talking through improvements in .NET MAUI. Xamarin being mobile-first understandably had some gaps with keyboard support—.NET MAUI has to have top notch mouse/keyboard support with desktop being a primary support platform. For variety of accessible devices/software solutions, semantic ordering of elements in the visual tree is important—Shane talked through some of the latest updates in .NET MAUI.
The .NET MAUI Community Toolkit presents an easy way to add latest accessibility features, before they are fully baked and ready to be added to .NET MAUI Core. There are new APIs to show/hide the soft keyboard on supported devices and updates to how input control text scrolls up when focus enables/disables the keyboard.
Rachel showed off several demos where lack of support for keyboard navigation would completely throw off the app UX—.NET MAUI has the needed support built-in so developers can do semantic ordering right. Shane and Rachel pointed out several resources for developers to learn more about accessible apps—cheers for raising awareness and to .NET MAUI helping apps be more inclusive.
That’s it for now.
We’ll see you next week with more awesome content relevant to .NET MAUI.
Cheers, developers!
This content originally appeared on Telerik Blogs and was authored by Sam Basu
Sam Basu | Sciencx (2023-03-27T14:06:01+00:00) Sands of MAUI: Issue #96. Retrieved from https://www.scien.cx/2023/03/27/sands-of-maui-issue-96/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.