Reader small image

You're reading from  The MVVM Pattern in .NET MAUI

Product typeBook
Published inNov 2023
Reading LevelBeginner
PublisherPackt
ISBN-139781805125006
Edition1st Edition
Languages
Right arrow
Author (1)
Pieter Nijs
Pieter Nijs
author image
Pieter Nijs

Pieter Nijs is a .NET consultant at Xebia in Belgium, with a keen interest in mobile and cloud development. He's been instrumental in diverse projects, from vast healthcare and telecom systems to compact LOB apps. Now, Pieter's exploring AI's potential to enhance customer projects innovatively. Passionate about technology, he actively experiments and shares knowledge as a conference speaker and trainer. Pieter has been awarded the Microsoft MVP Award since 2017, reflecting his unwavering passion and expertise in serving the community.
Read more about Pieter Nijs

Right arrow

Binding modes and the INotifyPropertyChanged interface

In Chapter 1, What Is the MVVM Design Pattern, we already discussed how data can flow:

  • One-way: From ViewModel to View
  • One-way-to-source: From View to ViewModel
  • One-time: Only once from ViewModel to View
  • Two-way: From ViewModel to View and from View to ViewModel

Now, let’s take a look at how this is handled in .NET MAUI.

Binding modes in .NET MAUI

.NET MAUI supports all of these data flows, represented through the Microsoft.Maui.Controls.BindingMode enum: OneWay, OneWayToSource, OneTime and TwoWay. There is in fact a fifth value as well: Default. Remember when we talked about bindable properties earlier in this chapter? When creating a bindable property, there are some optional values we can set. One of those optional parameters is defaultBindingMode. This allows us to set a default binding mode on a bindable property. On Entry, for example, it makes sense to have the default binding mode...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
The MVVM Pattern in .NET MAUI
Published in: Nov 2023Publisher: PacktISBN-13: 9781805125006

Author (1)

author image
Pieter Nijs

Pieter Nijs is a .NET consultant at Xebia in Belgium, with a keen interest in mobile and cloud development. He's been instrumental in diverse projects, from vast healthcare and telecom systems to compact LOB apps. Now, Pieter's exploring AI's potential to enhance customer projects innovatively. Passionate about technology, he actively experiments and shares knowledge as a conference speaker and trainer. Pieter has been awarded the Microsoft MVP Award since 2017, reflecting his unwavering passion and expertise in serving the community.
Read more about Pieter Nijs