Utilizing Community Toolkit behaviors
We’ve already seen one behavior from the Community Toolkit that turns an event into a command (EventToCommandBehavior
), allowing us to respond to these events in our ViewModel
.
The Community Toolkit is open source
The Community Toolkit is not officially part of .NET MAUI and consists of code supplied by (surprise!) the community – that is, developers independent of Microsoft. That said, the Microsoft documentation includes and increasingly integrates the Community Toolkit.
CommunityToolkit
provides a suite of behaviors to handle many other common programming needs. Many of these behaviors assist with validating input. For example, the CommunityToolkit
includes the following:
- Character validation
- Numeric validation
- Required string validation
- Text validation
- URI validation
You attach behaviors to controls. For example, let’s add a rule to the Login page stating that the username must be...