Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
.NET MAUI Cross-Platform Application Development - Second Edition

You're reading from  .NET MAUI Cross-Platform Application Development - Second Edition

Product type Book
Published in Mar 2024
Publisher Packt
ISBN-13 9781835080597
Pages 496 pages
Edition 2nd Edition
Languages
Author (1):
Roger Ye Roger Ye
Profile icon Roger Ye

Table of Contents (18) Chapters

Preface Part 1: Exploring .NET MAUI
Getting Started with .NET MAUI Building Our First .NET MAUI App User Interface Design with XAML Exploring MVVM and Data Binding Navigation Using .NET MAUI Shell and NavigationPage Software Design with Dependency Injection Using Platform-Specific Features Part 2: Implementing .NET MAUI Blazor
Introducing Blazor Hybrid App Development Understanding Blazor Routing and Layout Implementing Razor Components Part 3: Testing and Deployment
Developing Unit Tests Deploying and Publishing in App Stores Other Books You May Enjoy
Index

Data binding

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:

  • View: ItemDetailPage, see Listing 3.4 in the previous chapter
  • ViewModel: ItemDetailViewModel, see Listing 4.1
  • Model: Item (access through the IDataStore interface), see Listing 3.3 in the previous chapter

ItemDetailPage 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.

A diagram of a binding object  Description automatically generated

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.

Binding object...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}