Sands of MAUI: Issue #152

This week’s .NET MAUI news: mixed reality experiences, styling with StyleClass, white labeling apps, passthrough behavior and eye health.


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 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 & 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 July 22, 2024:

Mixed Reality Experiences

.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 .NET MAUI team hosts monthly Community Standup livestreams to celebrate all things .NET MAUI and provide updates—a wonderful way to bring the developer community together. Maddy Montaquila, Rachel Kang and TJ Lambert hosted the July .NET MAUI Community Standup, with special guest Ed CharbeneauMixed Reality with .NET MAUI.

After the usual coverage of community contributions and platform updates, it was time to explore a new frontier for .NET MAUI apps—mixed reality experiences with VR headsets. Meta Quest VR Headsets essentially run Android—a usual target platform for .NET MAUI apps. Ed was brave to strap on a Quest VR headset live on stream and showcase the mixed reality experience through casting.

VR/MR presents some unique challenges and opportunities—with a wide surface area and hand tracking with gestures, the lure of multitasking is clear. It is quite remarkable to see .NET MAUI, Blazor PWA and Blazor Hybrid apps all run seamlessly on Quest VR headsets. Ed walked through each experience and made the story enticing for developers. From flat 2D apps to rich spatial experiences, VR/MR does present a new frontier for .NET MAUI experiences—upwards and onwards.

.NET Community Standup - Mixed Reality with Ed Charbeneau - Maddy, Rachel, TJ and more

Styling in .NET MAUI

Modern cross-platform mobile/desktop apps often strive for delightful UX and beautifully styled UI is one way developers can achieve the goal. While there are multiple ways to style .NET MAUI apps, developers have to be conscious of doing things effectively—avoid writing unnecessary code and reuse styles. Charlin Agramonte wrote up a nice article on developer productivity with styling—simplifying .NET MAUI styles with StyleClass.

Styles classes enable developers to have multiple styles applied to a UI component—essentially, bringing in the concept of multiple inheritance to styles. Charlin starts out how .NET MAUI styles are commonly defined at the app level—more nuanced styles are often require extending existing styles with a BaseResourceKey attribute. While this is ok, it does lead to lots of style definitions—perhaps there is a way to simplify.

Instead of XAML styles applying to specific UI elements, they could be defined as styles using the Class attribute. UI elements can then utilize one or more styles together using StyleClass. Charlin makes the case for simplifying styling with some easy to follow examples—cheers for the pointers to better developer efficiency.

.NET MAUI StyleClass

White Labeling Apps

It’s July and time for #MAUIUIJuly again. Based on an idea originally started for Xamarin by Steven Thewissen, MAUI UI July is a month-long community-driven event where anyone gets to share enthusiasm and passion for .NET MAUI. Run by Matt Goldman, this is a great opportunity for .NET MAUI developers to learn from each other—MAUI UI July is happening throughout July 2024. The next article comes from Julian Ewers-Peters with an epic writeup—white labeling .NET MAUI apps.

We often come across apps/products that look and behave very similarly, but differ in colors/logos. White labeling is the common practice where one company develops a product and then rebrands it for other companies to sell under their own brand. Julian dives into what it takes to develop a single .NET MAUI app and easily rebrand it for different clients that share similar app requirements, but with their own branding.

Julian starts out with a .NET MAUI app with a unbranded default version and serving two fictitious clients. The goal is achieve two or three differently styled apps with the same code base under the hood. Beginning with the default .NET MAUI app configuration, Julian shows off how to manage client-specific logos, images, colors, styles, fonts, app names and identifiers, as well as touching upon custom app behavior.

For white labeling, Julian recommends a slightly altered .NET MAUI single project structure to keep client-specific resources organized—the goal is to switch up thing with custom build configurations. With Build Conditions, .NET MAUI apps can be instructed to grab appropriate assets—and .props files can be used to copy XAML resource dictionaries to a client-specific subfolders for the build. Thanks, Julian, for the pointers—a blueprint for customized client apps using a single .NET MAUI code base.

Three similar apps with different background colors and different logos

Passthrough Behavior

.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. And MAUI UI July perfectly celebrates developer excitement around .NET MAUI—there is fresh content ready to be bookmarked every day of July. The next MAUI UI July article comes from Matt Goldman himself with a wonderfully practical writeup—passthrough behavior with .NET MAUI.

While .NET MAUI provides abstractions for native UI rendering across platforms, customers may often want implement their consistent branded look-and-feel across the app. If using UI elements from the .NET MAUI Community Toolkit, the problem is exasperated—writing Handlers or replicating control functionality seems like a lot of work.

Matt’s smart solution is to create a simple reusable passthrough behavior attachment—instead of the control, the behavior is attached to the wrapper control, which then passes it down. Matt shows off the code to implement the elegant solution—the wrapper can have passthrough custom styles, while the wrapped UI elements maintain all their characteristics. Cheers for the inspiration.

stylized picture of a phone with a hologram of a screen

Eye Health

For modern knowledge workers, staring at bright screens throughout the day is how most folks get work done. Unfortunately, screens can cause digital eye strain and be accompanied by a wide variety of health issues. Thankfully, there are ways to minimize the impacts and Suzanne Scacca wrote up a wonderful article—5 ways to maintain eye health for screen workers.

Suzanne starts discussing the need to reduce eye strain—what can be nuisance in the beginning could lead to broader health issues, if remedial action is ignored. Giving our eyes a break could reduce the fatigue from screen time. Popular time-blocking strategies like the Pomodoro techniques can help.

Workspace ergonomics have a huge impact on eyes/body. Suzanne talks through equipment, posture and lighting. The right type of screen and configuration settings can also make a world of difference, as do efforts to keep eyes hydrated. Folks working in the technology industry or anyone dealing with screens all day can also see benefits by working on improving other aspects of physical health—sleep, diet and exercise are important for overall balance. Kudos, Suzanne, for bringing up a key health concern and talking through remedial measures that help us all.

illustrated ideas image

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


Print Share Comment Cite Upload Translate Updates
APA

Sam Basu | Sciencx (2024-07-22T16:20:45+00:00) Sands of MAUI: Issue #152. Retrieved from https://www.scien.cx/2024/07/22/sands-of-maui-issue-152/

MLA
" » Sands of MAUI: Issue #152." Sam Basu | Sciencx - Monday July 22, 2024, https://www.scien.cx/2024/07/22/sands-of-maui-issue-152/
HARVARD
Sam Basu | Sciencx Monday July 22, 2024 » Sands of MAUI: Issue #152., viewed ,<https://www.scien.cx/2024/07/22/sands-of-maui-issue-152/>
VANCOUVER
Sam Basu | Sciencx - » Sands of MAUI: Issue #152. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/22/sands-of-maui-issue-152/
CHICAGO
" » Sands of MAUI: Issue #152." Sam Basu | Sciencx - Accessed . https://www.scien.cx/2024/07/22/sands-of-maui-issue-152/
IEEE
" » Sands of MAUI: Issue #152." Sam Basu | Sciencx [Online]. Available: https://www.scien.cx/2024/07/22/sands-of-maui-issue-152/. [Accessed: ]
rf:citation
» Sands of MAUI: Issue #152 | Sam Basu | Sciencx | https://www.scien.cx/2024/07/22/sands-of-maui-issue-152/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.