Photo by Neora Aylon on Unsplash

.NET MAUI Community Toolkit

CODING ·
MAUI

The .NET MAUI Community toolkit is a package of reusable .NET MAUI components and elements, that just don't belong in the .NET MAUI framework, but are common enough that many people are asking for them. The purpose of this post isn't to dive deep into the technical aspects or event the usage of the toolkit (the docs do a great job of that), It's more to help shine a light on the wonderful work the community is putting in to help grow the .NET MAUI ecosystem.

I was recently asked by @mattgoldman if I’d like to put together a post for https://twitter.com/hashtag/MAUIUIJuly. After struggling for some inspiration recently for posts I figured this is the perfect excuse opportunity to jump back into it.

For those of you living under a rock and aren’t quite sure what .NET MAUI is and why you want to use it. Lets start with what is .NET MAUI.

What is .NET MAUI

Simply speaking MAUI stands for Multi-platform App UI. This is Microsoft’s attempt at a cross-platform native application framework. Think of it as a replacement for Xamarin.Forms. I’m not going to go through the How’s and Why’s of using .NET MAUI, there are already some great resources out there, check out the #MAUIUIJuly hashtag, Matt’s even working on the MAUI in action book.

Have you ever found yourself building a rich UI application, be it, WPF, UWP, Angular, React or mobile and find yourself searching for a seemingly standard control in the native framework that just doesn’t exist? So you end up either:

  1. (re)Writing your own
  2. Finding an unmaintained repository, that doesn’t quite work how you want it to.

I know I’ve found myself implementing, and reimplementing simple binding converters, layout panels, and alert popups.

Community Toolkits

Thankfully, Microsoft has been facilitating community-based toolkits for their frameworks for as long as I can remember (at least back to when I was heavily focused on WPF). These toolkits are home to the reusable components and elements that everyone needs but don’t really belong in the underlying framework.

.NET MAUI Community Toolkit

The .NET MAUI Community Toolkit is one such toolkit that is invaluable for .NET MAUI app development.

To get started the official Docs are found here whilst the repo is on GitHub. First and foremost, as this is a community-based toolkit there are rich discussions, as well as guidelines on how to contribute and participate. As well as the monthly standup on youtube.

What’s in it?

Converters

There are a plethora of converters from IntToBoolConverter and InvertedBooleanConverter to many different Color converters. Before you decide to roll your own Color to RGB string converter (or any other everyday converter) be sure to check out the offerings already available in the Community Toolkit.

Alerts

These are common controls that almost all Apps I’ve written use, and I’ve created more than alerts controls than I’d like to admit (across WPF, Angular and React), or had to wrangle from other open source projects. The .NET MAUI Community Toolkit provides 2 simple to use alert options: Snackbars and Toast

Behaviours

The toolkit has your Email, Max Length, and URI validation (amongst many others) covered. Need to tint an Icon? Animate a progress bar? Identify when the user has finished typing.

Views

Need to allow your users to draw on the screen? Well, there’s the Drawing View. How about a Popup? Yep, there’s one of those too. And even an Avatar View

Layouts

As it stands now there is only a UniformItemsLayout, this handy layout control allows you to easily create a layout that uniformly places all child elements.

Conclusion

The .NET MAUI Community Toolkit is a valuable package for any .NET MAUI Application. the rich discussions and community will mean that the highlights I’ve mentioned above will soon be outdated, so be sure to keep an eye on the discussions, and the monthly standup.