Telerik blogs

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 towards developer knowledge in .NET MAUI and we grow a community/ecosystem willing to learn & 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 December 12, 2022:

Desktop Apps with .NET MAUI

.NET Conf saw the release of .NET 7, along with loads of announcements for all types of .NET development—every .NET Conf session is now available on demand. There obviously was no dearth of love for .NET MAUI, with dedicated sessions every day highlighting the progress that runtime/tooling are ready for .NET 7. Shane Neuville from .NET MAUI engineering team did a wonderful session—recapping what's new in .NET MAUI and showcasing latest in desktop app support.

Shane started out with the big .NET MAUI for .NET 7 announcement, before mentioning several new features, like Dual Screen support, Window Positioning and Accessibility improvements. It was then time to dive into all things desktop—.NET MAUI is the next generation of .NET cross-platform story, and desktop support is a first-class citizen.

Shane had a nice sample app to showcase all the latest desktop-friendly features that are now built into .NET MAUI—like Tooltips, Context Menus, Pointer Gesture Recognizer, Foldable screen support, Window Location APIs, MenuFlyoutSeparator and much more. Enterprises are looking at .NET MAUI to build apps that are desktop-first—that just happen to be cross-platform with a single shared codebase.

The future looks good for new desktop apps with .NET MAUI or modernizing existing desktop apps to .NET MAUI stack—developers have all the needed ammunition.

Xamarin.Forms to .NET MAUI

.NET MAUI running on the latest .NET 7 runtime and stable tooling should be providing developers with more confidence—it might be time to move apps from Xamarin land over to .NET MAUI. Sure, there is plenty of guidance, but nothing beats the experience of seeing another expert developer do the migration on a real-world app. James Montemagno is here to oblige, and did a long livestream on upgrading apps from Xamarin.Forms to .NET MAUI.

James started out providing latest updates around .NET MAUI and tooling, followed by some honest Q&A. When it comes to migrating apps from Xamarin.Forms to .NET MAUI, there is guidance for manual steps and using automation tooling like the .NET Upgrade Assistant.

James chose the existing famed MyCoffee Xamarin.Forms app to move over to .NET MAUI, starting with migration of the current project file. The next step was using the .NET Upgrade Assistant, which while not a magic wand, gets things going really nicely for migration.

As is true for most real-world apps, James had a bunch of things to fix up manually, but at the end—voila, the Coffee App was moved over and now running on .NET MAUI. Experiences like this should inspire more developers to move apps over from Xamarin land to .NET MAUI—there is plenty of help.

NoSQL with LiteDB

.NET MAUI apps for mobile/desktop will often need to store data locally on the device—for caching, storage, settings and a host of other use cases. NoSQL databases can be helpful in storage and quick retrieval of large amounts of non-relational data. Daniel Hindrikes had produced a wonderfully beneficial video—working on NoSQL with LiteDB for .NET MAUI apps.

Daniel likes to demonstrate concepts with real-world examples—a multi-tabbed .NET MAUI app with forms over data would get the point across. A local database inside the .NET MAUI app can do data storage and LiteDB can lend a helping hand—an open source NoSQL database.

Daniel starts off bringing in the LiteDB NuGet package and proceeds to implement a data service for storage and retrieval of data. With a new LiteDB database created at given device file path, C# objects/collections can be easily written to and read from the database.

If data security is a priority, Daniel showcases how to encrypt the database using secure file storage—streams of data can now be written and read securely inside .NET MAUI apps.

SQLite with .NET MAUI

The holiday season is upon us and it's time for Advent Calendars—fun, everyday surprises leading up to Christmas. .NET MAUI developers can rejoice—there is a dedicated .NET MAUI tech Advent Calendar 2022, an initiative led by Hector Perez and Luis Beltran. A recent post in the .NET MAUI Advent Calendar was written by Luis Beltranworking with foreign keys in local SQLite databases within .NET MAUI apps.

.NET MAUI apps may often have the need to store relational data locally on devices—SQLite can help with local database storage. However, a more realistic need may be when local databases have multiple tables that are related and foreign keys are needed for query references.

Luis sets out to demonstrate how to handle such data relations in his detailed article, starting with a fresh .NET MAUI app project. Once the SQLite dependencies are brought into a .NET MAUI app, developers can start writing SQL operations on defined databases/tables—all CRUD (Create/Read/Update/Delete) queries are supported. Luis showcases how to match up Models to data storage and writing queries that go across tables referenced by foreign keys. This article dives into real world developer use cases with detailed code and open sourced sample project—cheers, Luis.

Breadcrumbs in Mobile

.NET MAUI easily invites web content into native cross-platform apps—a modern WebView component makes it possible to share code/styles across web, mobile and desktop. However, not everything meant for the web translates nicely to mobile form factors.

The breadcrumbs navigation pattern is popular on the web—when done right, breadcrumbs let users see where they are, where they can go and provide easy navigation through levels of content. This is not so easy for mobile, and Suzanne Scacca wrote a wonderful new article—best practices for designing breadcrumbs for mobile.

Suzanne starts out explaining the few types of mobile breadcrumb navigations—location and attribute based ones are common. Mobile web design is always a delicate balancing act, providing users with content and features, but not at the expense of usability or accessibility.

Suzanne recommends using breadcrumbs on mobile only when the benefit is real—with web content at least three layers deep. Wrapping and scrolling breadcrumbs can be tricky on mobile, and developers/designers need to use size/space to improve tap targets on breadcrumbs. With some design thinking, breadcrumbs for web can work when brought over to mobile/desktop land with .NET MAUI—thanks for the pointers, Suzanne.

That's it for now.

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

Cheers, developers!

Telerik UI for .NET MAUI: Kickstart your multiplatform application development


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.