Sands of MAUI: Issue #162

This week’s .NET MAUI news: .NET MAUI Community Standup 4, 9, 12, 16, 18, 35; interactive gestures; Toolkit SemanticOrderView; Blazor Hybrid in WinForms; and varying iOS entitlements.


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 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 October 7, 2024:

.NET MAUI Community Standup

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. A lot of good things are happening for .NET MAUI developers, and the community is reaping the benefits. David Ortinau and Rachel Kang hosted the October .NET MAUI Community Standup with a cryptic title—4, 9, 12, 16, 18, 35 with .NET MAUI.

After some usual banter and community updates, the duo got down to explaining the numbers. The .NET MAUI bits for .NET 9 mark the fourth major release for .NET MAUI, and there is a lot going on in .NET MAUI land. David did a recap of .NET MAUI enhancements for .NET 9—Native Embedding, HybridWebView, MainPage updates, UI performance tuning, tooling updates and more.

The .NET MAUI team and the developer community is looking forward to Nov 12—.NET 9 bits arrive with first day of .NET Conf. The discussions then turned to platform updates—XCode 16 support, iOS 18 features and Android API 35 updates. While .NET MAUI democratizes cross-platform reach, developers will do well understanding the nuances of underlying platform dependencies and continuous changes. There is developer community excitement and community contributions are building up for the next milestone of .NET MAUI—upwards and onwards.

.NET MAUI Community Standup 4, 9, 12, 16, 18, 35 - Rachel Kang and David Ortinau

Interactive Gestures

.NET MAUI is designed for building modern, multi-platform, natively compiled iOS, Android, macOS and Windows apps, using C# and XAML in a single codebase. Across platforms, .NET MAUI apps have to work with various input mechanisms, like touch and mouse-keyboard. Modern mobile/desktop apps need to be interactive for optimal UX and .NET MAUI sets up developers perfectly with consistent support for gestures across platforms. James Montemagno produced a short video that might help—adding interactive gesture support to .NET MAUI UI.

James starts with the basics of an empty .NET MAUI app with a box UI and begins adding interactive gesture support. .NET MAUI has built-in support for GestureRecognizers, that can be attached to any UI element in the visual tree—either through XAML or C#.

James shows off adding SwipeGestureRecognizer and TapGestureRecognizer to UI elements, along with wiring up event handlers that developers can use to take action when gestures are recognized. Adding interactive gesture support to cross-platform apps is really easy in .NET MAUI—yet another way the framework helps developer be successful.

Adding Interactive Gestures to Controls in .NET MAUI - James Montemagno, MAUI Minutes

Toolkit SemanticOrderView

.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. Modern cross-platform apps are complex though—developers have to think through ideation, design and development, and can use all the support from frameworks/toolkits.

Accessibility features are critical for modern apps to be inclusive and expand the reach of user base. Leomaris Reyes wrote up a wonderful article on a much-desired accessibility feature—exploring SemanticOrderView in .NET MAUI Community Toolkit.

The .NET MAUI Community Toolkit is a curated collection of reusable components thoughtfully developed by Microsoft and the developer community. It encompasses a range of elements such as animations, converters and behaviors, all designed to accelerate .NET MAUI app development.

Leomaris starts with explaining the SemanticOrderView—a handy API built inside the .NET MAUI Community Toolkit. SemanticOrderView allows developers to set the order in which screen readers read the visual elements on screen, so that it’s better understandable to users who do not have the visual context—this is wonderful for increasing app accessibility.

Leomaris makes the case for Semantic Order with a form where visual UI elements may need to read in a different order compared to how they appear visually. Starting from bringing in the .NET MAUI Community Toolkit, Leomaris showcases the developer experience to implement a SemanticOrderView and rendering visual elements in a different order compared to how they would be read by screen readers. Thanks to the .NET MAUI Community Toolkit, developers can easily organize UI elements more intuitively, making it easier for people with visual disabilities to use .NET MAUI apps—cheers to that.

SemanticOrderView

Blazor Hybrid in WinForms

While .NET MAUI is squarely meant for developers to build native mobile/desktop apps, armed with modern smart WebViews, .NET MAUI is more than capable of welcoming web content to native land. In fact, Blazor/JavaScript developers should feel empowered to bring web UI components, routing, styling and more to native cross-platform .NET MAUI apps, while gaining complete native platform API access. Blazor Hybrid can also be a great strategy to modernize older desktop apps, and Claudio Bernasconi wrote up an excellent article to drive the point home—using Blazor components in WinForms apps with Blazor Hybrid.

Older WinForms/WPF apps can be modernized with Blazor, but the first step is to upgrade the runtime to .NET 6 or later. This opens up the possibility of bringing in the WebView2 NuGet package that knows how to render modern web components. Claudio chooses to showcase a simple but realistic WinForms app view with a ListBox on the left and a Blazor component on the right—a typical window in an employee management software. The native WinForms ListBox contains the names of all employees and, upon selection, detailed employee information is rendered on the right with a Blazor web UI component.

Claudio lists out the actual steps developers need to take to add Blazor support to an existing WinForms app, and then goes on to demonstrate the developer experience of passing parameters to Blazor components from WinForms—a true showcase of mixing technology stacks. Modernizing legacy desktop apps can be challenging, but rendering Blazor components, passing parameters and consuming services are all possible when integrating the BlazorWebView component within WinForms/WPF apps—here’s to modernization with Blazor Hybrid.

Blazor Hybrid with WinForms

Varying iOS Entitlements

.NET MAUI is the evolution of modern .NET cross-platform development stack, allowing developers to reach mobile and desktop form factors from a single shared codebase. For developers targeting iOS/MacCatalyst with .NET MAUI, it always helps to understand the Apple ecosystem and how to configure app settings during development versus in production.

Entitlements are special permissions that allow apps to use certain services provided by Apple, like iCloud, in-app purchases or push notifications—and all such app capabilities are managed in the app’s Entitlements.plist file. Developers have configurability options with Entitlements, and András Tóth wrote up a nice article—using different ioS Entitlements for Debug/Release modes for .NET MAUI apps.

Push notifications are an excellent way to keep users engaged, but usually need a little configuration to test functionality. András explains a key entitlement for iOS apps—the APS-environment (Apple Push Services environment) is used to specify the environment for push notifications. This entitlement informs Apple’s servers whether the app is running in a development environment or in production, determining which server to send the notifications through.

This Development/Production APS-environment configuration helps separate testing from live user interactions and avoids accidental notification delivery to users during testing. András walks through how developers can configure different APS-environments for Debug or Release mode for .NET MAUI apps targeting iOS—essentially two Entitlements.plist files are to be used conditionally as specified in the .csproj file.

With simple conditional configuration, .NET MAUI developers can have peace of mind while implementing Push Notifications for iOS apps in development/production modes—appreciate the tip, András.

.NET MAUI mascot waving

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-10-07T16:53:49+00:00) Sands of MAUI: Issue #162. Retrieved from https://www.scien.cx/2024/10/07/sands-of-maui-issue-162/

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

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.