MVVM architecture, as you saw in the Chapter 4, Developing Mobile Applications with Xamarin, mainly concentrates on data and how to decouple data from views. However, this decoupling does not mean the views and controls created should not respond to data content changes, either as a result of user input or state data being updated. In order to facilitate the propagation of data models, from the view model to view, as well as between views, data bindings and other data-related Xamarin.Forms mechanisms are crucial tools.
The simplest data binding in Xamarin.Forms is comprised of the path of the property we want to link to the current view property. In this type of declaration, we assume that the BindingContext
of the whole and/or the parent view is set to use the target source view model.
If we take a look at the navigation implementation from our ListItemView
to ItemView
, you will notice that the selected item from the list is set as the binding...