Patterns and best practices
In this section, we will discuss several implementation patterns and tools that developers generally resort to while developing Xamarin.Forms applications. Messaging and dependency injection features will be discussed further in Chapter 9, Reusable UI Patterns.
Messaging infrastructure
In an ideal implementation of the Model-View-ViewModel (MVVM) or Model-View-Presenter (MVP) pattern, each screen is self-contained; the screen modules for the view, model, and the mitigation components communicate with each other using various communication channels.
However, in complex applications, there is sometimes the need for a communication channel between these self-contained elements, since the result of an action on one of the screens should be propagated to other unrelated section(s) of the application with a shared interest in the result of this very action. As a solution to this problem, in MVVM frameworks such as MVVMCross, Prism, or MVVM Light, it is common to see an...