What this book covers
Chapter 1, The MVVM Design Pattern, provides an overview of the core components of the MVVM pattern, showing their roles and interplay. It illustrates the value of separating UI from logic for better testability and maintenance. It addresses common MVVM misconceptions and offers a foundational grasp of MVVM, regardless of specific technology.
Chapter 2, What Is .NET MAUI?, gives an overview of the overarching landscape of .NET MAUI, its pivotal features and advantages, and its architecture. It provides insights into .NET MAUI’s origins from Xamarin and Xamarin Forms, and its evolutionary journey.
Chapter 3, Data Binding Building Blocks in .NET MAUI, shows how data binding in .NET MAUI, a cornerstone for MVVM, is an essential part of .NET MAUI. This chapter unpacks the key principles, elements, and techniques underpinning this essential feature.
Chapter 4, Data Binding in .NET MAUI, builds upon the previous chapter but delves deeper into its intricacies and nuances, offering a comprehensive exploration of all the aspects of data binding in .NET MAUI.
Chapter 5, Community Toolkits, zeros in on two influential community toolkits: the MVVM Toolkit and the .NET MAUI Community Toolkit. It shows how these community-driven initiatives can amplify the effectiveness of MVVM in your .NET MAUI applications.
Chapter 6, Working with Collections, provides an overview of how to effectively display datasets using MVVM in .NET MAUI. From binding data and adapting to its changes to crafting data templates, this chapter offers an MVVM-centric guide to presenting data and facilitating user interactions with it.
Chapter 7, Dependency Injection, Services, and Messaging, illuminates the methods of aligning a ViewModel with a view via service registration and dependency injection. It highlights the nuances of injecting services into a ViewModel and facilitating seamless communication between ViewModels using messaging, all while upholding separation of concerns and enhancing testability.
Chapter 8, Navigation in .NET MAUI, is all about MVVM-based navigation. This chapter provides an overview of what .NET MAUI Shell is and its implications for navigation. It shows how to construct a navigation service tailored for both .NET MAUI apps that leverage Shell and apps that don’t.
Chapter 9, Handling User Input and Validation, shows how to effectively handle user input, from validating data at the ViewModel level, standard and custom validation rules, to prompting the user for confirmations or cancellations in the presence of unsaved changes.
Chapter 10, Working with Remote Data, shows how to work with remote data, introduces repositories for maintaining separation of concerns, and utilizes dependency injection. It illustrates how to use Refit for streamlined API interactions, and how to handle asynchronous tasks and their UI implications.
Chapter 11, Creating MVVM-Friendly Controls, dives into the creation of custom controls that are tailored for MVVM, supporting data binding and interactivity through commands.
Chapter 12, Localization with MVVM, provides an overview of the techniques to localize hardcoded labels within the app, and how to effectively fetch language-specific data from APIs.
Chapter 13, Unit Testing, shows how easy and essential unit testing is. It guides you through setting up a unit test project, generating data, mocking dependencies, and testing MAUI code.
Chapter 14, Troubleshooting and Debugging Tips, highlights common hiccups and their solutions. It shows typical issues and pitfalls concerning data binding, dependency injection, and building custom controls and converters.