Chapter 3: MVVM for Maintainability and Testability

When building Extensible Application Markup Language (XAML)-based applications, one of the most important design patterns to learn is the Model-View-ViewModel (MVVM) pattern. MVVM provides a clear separation of concerns between the XAML markup in the view and the C# code in the ViewModel, through the use of data binding. With this separation comes ease of maintenance and testability. The ViewModel classes can be unit tested without any dependency on the underlying user interface (UI) platform. For large teams, another benefit of this separation is that changing the XAML enables UI designers to work on the UI independently of developers who specialize in writing the business logic and the backend ...

Get Learn WinUI 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.