Telerik blogs

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 December 16, 2024:

AI Building Blocks

It is the age of artificial intelligence. AI is slowly changing the way we live and work, and AI’s popularity is driving adoption in enterprise and consumer apps. AI presents a huge opportunity for .NET developers to infuse apps with solutions powered by generative AI and large language models (LLMs), as well as boost developer productivity. However, until now, there’s been no single standard representation for AI concepts within .NET itself, so developers would have to reinvent the wheel when integrating with AI services. All that changes with Microsoft.Extensions.AI, and Steve Sanderson did a session at .NET Conf 2024 to walk through the new standard—AI building blocks with a new unified AI layer.

Most .NET apps can be made more powerful and productive through AI features, such as semantic search, auto-classification, summarization, translation, data extraction and even chat-based assistants. Microsoft.Extensions.AI provides a new set of standard APIs for AI services, including large language models (LLMs) running locally or as hosted services, integrating with text embeddings, vector stores and more.

With Extensions.AI, .NET developers can lean on a standard abstraction to integrate AI services, making apps better architected against breaking changes in AI models or implementations. Steve demonstrated the new Extensions.AI providing standard abstractions that allow developers flexibility to work with and swap AI services—always a nice showcase with easy-to-follow code. As .NET developers increasingly look to infuse apps with AI smartness, Extensions.AI ushers in a new era of stability and productivity with standardization of .NET implementations across services.

AI Building Blocks—A new, unified AI layer - .NET Conf 2024 - Steve Sanderson

.NET MAUI Performance

.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. However, building modern real-world cross-platform apps from a single shared codebase is not meant to be easy—let alone with nuanced performance optimizations across platforms. Thankfully for .NET MAUI developers, a lot of performance tricks are already built into the development stack and Jonathan Peppers doubled down with a wonderful session at .NET Conf—.NET MAUI performance optimizations with Native AOT and trimming.

While building a cross-platform app, .NET MAUI can use a linker called ILLink to reduce the overall size of the app with a technique known as trimming. ILLink reduces the size by analyzing the intermediate code produced by the compiler—it removes unused methods, properties, fields, events, structs and classes to produce an app package that contains only code/assembly dependencies that are necessary to run the app.

Native AOT deployment, on the other hand, produces .NET MAUI app package that’s been ahead-of-time (AOT) compiled to native code. The combination of Native AOT and trimming can be vital tools for .NET MAUI developers to optimize performance—they help reduce app package size, while making startup and build times faster.

The one and only Jonathan Peppers did a detailed walk-through of performance tricks for .NET MAUI app developers, including the new Native AOT and trimming support and advising NuGet packet library authors on ways to leverage performance tuning. Overall, this was a wonderful showcase of performance tuning cross-platform apps and the better results they produce—a must watch for .NET MAUI developers looking to squeeze out every bit of performance.

.NET Conf—.NET MAUI performance optimizations with NativeAOT and Trimming - Jonathan Peppers

.NET Community Toolkit

Modern .NET is powerful, open-source, cross-platform and welcoming to all, with mature tooling accompanied by rich ecosystems. With .NET 9, developers see significant enhancements across .NET Libraries, Runtime and SDKs, all toward building modern client, cloud native and intelligent apps. There is additional productivity help for .NET developers, and Sergio Pedri wrote up the announcement—.NET Community Toolkit 8.4 is out now.

The .NET Community Toolkit is a collection of helpers and APIs that work for all .NET developers, agnostic of any specific UI platform. One of the most popular feature requests for the MVVM Toolkit source generators was support for partial properties. .NET Community Toolkit now has support for partial C# properties, thanks to new language features in .NET 9. The 8.4 release also includes lots of new MVVM Toolkit analyzers. Developers get a rich set of diagnostic analyzers, which help make sure code is written correctly and without common mistakes. There are lots of bug fixes and enhancements across the .NET Community Toolkit—a wonderful collaborative effort that makes .NET/.NET MAUI developers way more productive.

Announcing .NET Community Toolkit 8.4

XAML Basics

.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. A large majority of .NET client apps have their UI visual tree described in XAML—the popular declarative markup used in WPF/WinUI/Xamarin.Forms/.NET MAUI. While seasoned .NET MAUI developers know how to leverage the strengths of XAML, it can be a learning curve for developers just starting out. Thankfully, there is some help and Vijay Anand EG has started a wonderful article series—XAML basics for beginners.

Vijay begins with the basics of XAML—an acronym for eXtensible Application Markup Language, which has been a popular declarative markup for describing .NET UI since 2006. XAML offers some unique advantages to developers—like rich UI design, separation of UI/logic and interoperability with C#. Vijay dives into some of the core fundamental basics of working with XAML, like namespaces, elements with attributes, attached properties, data binding, markup extensions and more. In the two parts published, Vijay covers substantial ground with XAML basics—much to look forward to for the rest of the series.

Mainpage.xaml screenshot

GitHub Models

Modern AI large language models (LLMs) are quite the tech-tonic shift in how general purpose they are and the amount of computing they operate on at scale/diminishing cost. However, AI models for all their smartness can have some pitfalls developers will do well to understand. Not all AI models are the same, and capabilities/efficiency/hallucinations can vary. Developers can use a playground to select AI models before trying for app integration and Hassan Djirdeh wrote up a nice article—GitHub Models explained.

Hassan starts with the basics to introduce GitHub Models—a platform designed to help developers experiment with and integrate AI-driven functionalities seamlessly into their projects. GitHub Models offers a simple way to find AI models through the GitHub Marketplace—developers can explore available models marked with descriptions, capabilities and compatibility information. A walk-through of the interactive playground shows the benefits of GitHub Models—developers can tinker with AI model parameters and compare models side-by-side.

Hassan also goes on to talk about integrating AI models into apps directly with GitHub’s API layer and testing model interactions right inside VS Code—GitHub Models represents an important step forward in democratizing AI for developers. By offering tools for discovery, experimentation and deployment all within the GitHub ecosystem, GitHub empowers developers to explore and implement the best-fitting AI-driven solutions.

GitHub Models

That’s it for now.

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

Cheers, developers!


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.