Behaviors Library for .NET MAUI
Inspired by the Blend SDK, David Britch splits behaviors into two concepts — behaviors that listen for something to happen, and actions triggered in response. He brings his Xamarin.Forms library forward to .NET MAUI.
What you’ll learn
- The two building blocks —
EventHandlerBehaviorandDataChangedBehaviorfor reacting to events and data changes - Available actions — invoking commands and methods, setting properties, running fade/rotate/scale/translate animations, and triggering visual states
- Reducing boilerplate — moving event-handling logic out of code-behind and into XAML
- Using the library — a three-step process to add it to a .NET MAUI project and consume it from XAML
- A worked example — invoking multiple commands from a
ListView.ItemSelectedevent
Read the full post for the XAML examples and a link to the library and sample repo.