.NET MAUI and Xamarin has been adhering to the MVVM design pattern since their inception. While .NET MAUI provides developers with additional flexibility by adopting the MVU pattern (see: Introducing .NET Multi-platform App UI), MVVM remains a widely popular approach for architecting mobile applications.
MVVM allows for loose coupling between data, business logic, and UI. In .NET MAUI, UI is usually defined in XAML (although you can declaratively define your UI in C# code too). Your UI is called a 'view' - a view can be a page or a UI element, although UI elements that are not complete pages are more often referred to as controls.
❌ Figure: Bad Example - Logic and properties are in the code behind, which decreases maintainability and testability
✅ Figure: Good Example - Values are bound to properties of the ViewModel, and actions are bound to Commands in the ViewModel
.NET MAUI supports MVVM out of the box, but there are several MVVM frameworks available that enhance this functionality. For example, some MVVM frameworks support "convention over configuration", allowing you to just code your View and ViewModel and let the framework hook them up for you. Some include: