.NET MAUI in .NET 7 Fills In Xamarin Gaps
With the new .NET MAUI in .NET 7 Release Candidate 1, the dev team has continued to polish things up ahead of a November GA debut while at the same time filling in gaps from its predecessor, Xamarin.
.NET Multi-platform App UI (MAUI) is called the "evolution of Xamarin.Forms" by Microsoft because it lets developers create desktop apps in addition to the traditional Xamarin mobile targets, iOS and Android.
In announcing .NET MAUI in .NET 7 RC1 this week, Microsoft's David Ortinau noted that even while the dev team has been busy responding to developer feedback with high-priority fixes while it polishes up the overall quality and reliability of the toolkit, it has continued to add new features to bring it up to par with Xamarin.
".NET 7 RC1 includes the highest priority quality fixes based on your GitHub feedback. Maps and DualScreen join .NET MAUI in .NET 7 to fill two gaps for mobile developers upgrading from Xamarin," said Ortinau, principal product manager. "We have also added some fundamental desktop features for tooltips, right-click, hover, window size, and context menus."
One of those gaps is filled with a new
Map control. "This control is ideal for displaying and annotating maps using the native maps from each mobile platform," Ortinau said. "You can draw shapes on the map, drop pins, add custom pins, and even geocode street addresses, latitude, and longitude."
The other mentioned Xamarin gap, DualScreen, isn't addressed further in the announcement post or in the release notes, though there has been some GitHub discussion about it, and there's a Xamarin.Forms.DualScreen NuGet offering that was updated about two months ago.
Fleshing out the desktop side of things, Ortinau said, "In response to your needs and feedback, we have surfaced a few useful features targeted at creating better desktop experiences including context menus, tooltips, pointer gestures, right-click mapping on tap gestures, and more control over the window size."
Following are Ortinau's descriptions of some desktop highlights:
- Context Menu: "You can now attach a context menu to any visual element using a MenuFlyout control. When the user right-clicks that view, the flyout will appear in that location when run on a desktop platform."
- Tooltips: "Sometimes you want to provide details about what an element is onscreen when the user hovers the cursor over it. We have added a simple attached property for you to set that text, and the display and disappearance of the tooltip with automatically be triggered. This is the same pattern used for adding accessibility descriptions via semantic properties."
- Gestures: "Desktop apps need a few gestures that aren't used on mobile, so in .NET 7 we are adding a pointer gesture for handling hover events and a button mask for secondary (commonly right-click) taps."
Window Size and Position: "We've added properties and events to the Window so you have control at the cross-platform layer rather than writing platform code. These include:"
- X/Y position (not supported on macOS)
- Width/Height (not supported on macOS)
- Minimum Width/Height
- Maximum Width/Height
All of the above and many more fixes, tweaks and feature additions are explained in more detail in the voluminous release notes.
David Ramel is an editor and writer for Converge360.