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 January 17, 2023:

.NET MAUI Data Binding

Most .NET MAUI apps for mobile/desktop will end up displaying some data through UI—the magic glue that holds things together is Data Binding. MVVM (Model-View-ViewModel) is an architectural design pattern that works particularly well with Data Binding in C#/XAML codebases—MVVM can help keep sanity in codebase with separation of concerns and high testability. One of the most-watched instructional videos around .NET MAUI development comes from James MontemagnoData Binding with MVVM.

James starts with the basics of Data Binding concepts: With two-way data binding built into .NET MAUI, an object collection can update the UI as things change and vice versa. A simple To-Do list app is used to illustrate data binding principles—James begins with INotifyPropertyChanged interface implementations to demonstrate simple data binding.

With core principles under the belt, it is comforting to know that .NET developers do not have to write the MVVM boilerplate manually—the .NET Community Toolkit has all the MVVM plumbing built right in. Armed with the .NET Community Toolkit NuGet package, .NET developers can simply decorate object properties or mark event handlers as RelayCommand implementations—all of the wiring is auto-generated, thanks to source generators. Data Binding combined with MVVM continues to be a powerful development paradigm for .NET MAUI developers—productivity for the win!

.NET MAUI Popups

Popups are a great way to keep user engaged, particularly on mobile devices. While there are a few ways of doing Popups in .NET MAUI, developers are looking for ways that are truly cross-platform and with a high level of customizability. Gerald Versluis produced a polished video that can help—.NET MAUI Popups with Mopups.

Folks may have been familiar with Rg.Plugins.Popups in the Xamarin world—Mopups seem to be the community-driven successor to that. As usual, Gerald starts from the basics and guides us through the developer experience of installing and configuring the Mopups Plugin.

The next steps are creating Popup pages and figuring out navigation with the rest of the .NET MAUI app. Gerald is happy to dive into more advanced topics like animating Popups, customizing all things with Popups and using Mopups with Dependency Injection. Popup interaction from .NET MAUI apps is a great idea—developers have tools at their disposal.

Mac Pairing for .NET MAUI Development

.NET MAUI is the modern .NET cross-platform framework reaching iOS, Android, Windows and macOS. One of the most commonly asked questions is, would developers need to have a Mac to target iOS with .NET MAUI? Since .NET MAUI apps are essentially native platform apps compiled from .NET abstraction, a macOS device is needed—physical or virtual. However, .NET MAUI developers can still stay on Windows as their development platform—just with the need of reaching the Mac for building iOS apps natively.

Leomaris Reyes wrote up the perfect guided article—pairing with Mac to build .NET MAUI apps on Windows.

If developers have the needed bits installed for .NET MAUI development, the handshake between Windows and macOS isn't difficult. The Mac side needs XCode and associated tooling installed, while Windows needs modern Visual Studio installed with .NET MAUI development workloads.

Leomaris walks through all the steps needed to reach a physical or remote Mac from Windows—enabling remote login on macOS and pairing Visual Studio to macOS, either automatic or manual. Once paired, developers can see iOS device/simulator targets from Visual Studio on Windows, as well as be able to use Command Line tools with specified parameters. Just like Xamarin ecosystem, .NET MAUI offers flexibility—developers can be on Windows or macOS as their development platform of choice.

Platform Code with .NET MAUI

.NET MAUI is all about code reuse and cross-platform abstractions that reach mobile/desktop platforms effortlessly. However, developers building cross-platform apps with .NET MAUI might benefit knowing the native platform nuances—and at times, be ready to dive into native land. Luis Beltran had done a wonderful session at .NET Conf 2022—tips and tricks on platform code implementations in .NET MAUI.

While developers might have a need to get down to the platform-specific level, .NET MAUI can still help with higher level C# abstractions that have concrete implementations on a per platform basis. Luis offers plenty of tips on clean architecture when working with native platform code—shared Interfaces and Dependency Injection can help before native class implementations are housed in platform-specific folders. With .NET MAUI modern UI architecture, another option for developers is to go the shared Handler route—partial classes can serve up platform-specific implementations.

Bottom line is, developers have flexibility in working with native platform code—.NET MAUI can help with clean architecture and code reuse.

.NET SDK Manager with .NET MAUI

With .NET MAUI being production ready for .NET 6/7 and tooling being stable on both Windows/macOS, a lot more developers are building cool things with .NET MAUI. Joachim Leonfellne has built something awesome and inspiring for the rest of us—meet Dots, the friendly .NET SDK manager. The project is open source and set to be a super handy tool for fellow .NET developers.

The concept of workloads is relatively new in the .NET ecosystem and management of workloads can get tricky with Visual Studio installations. For folks who tinker with Preview bits and SDKs, managing .NET runtimes can get complicated—having visibility and being able to switch runtimes/workloads is golden.

Dots is a GUI to manage .NET SDKs/Workloads—it's written with .NET MAUI and available on Windows/macOS. Joachim saw the opportunity for .NET developers and dog-fooding .NET MAUI to build something useful.

While Dots UI looks gorgeous and it promises to be rather handy for .NET developers, Joachim does acknowledge the struggles with publishing .NET MAUI apps—hope the story gets better with time. A polished cross-platform app written with .NET MAUI that's actually useful to .NET developers—cheers for the inspiration Joachim!

That's it for now.

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

Cheers, developers!

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 are disabled in preview mode.