-
Book Overview & Buying
-
Table Of Contents
.NET MAUI Cross-Platform Application Development - Second Edition
By :
Let’s explore how MVVM and data binding works. We can use an item detail page implementation in our app to analyze how data binding works. The following list includes the view, ViewModel, and model that we are going to explore:
ItemDetailPage, see Listing 3.4 in the previous chapterItemDetailViewModel, see Listing 4.1Item (access through the IDataStore interface), see Listing 3.3 in the previous chapterItemDetailPage is a view used to display the content of an instance of Item. The data is retrieved from the ViewModel. The UI elements presenting the content of Item are connected to the ViewModel instance through data binding.

Figure 4.4: Data binding
As we can see in Figure 4.4, data binding is used to synchronize the properties of target and source objects. There are three objects involved in data binding and they are the binding target, binding source, and binding object.