liveBook · Manning

Binding source property

As explained in .NET MAUI in Action

A binding source property is the property whose value is propagated by a data binding to its target property.

A binding source property is the property whose value flows to a target property. Data binding keeps the target updated when the source changes, reducing direct UI reads and writes. section 3.4 section 3.5

Use these rules when choosing or configuring a source property:

  • Match the source property type to the target property type, or use a value converter when the types differ. section 3.4
  • Set a view's binding context to its source object, then reference source properties by name. section 3.4
  • Bind UI properties to code properties, other UI properties, or collection data such as a List displayed by CollectionView.ItemsSource. section 3.4 section 3.5

A changing source updates the UI

In a .NET MAUI page, an Entry exposes its user-entered value through its Text property. Bind a target property to a matching source property, and changes in that source value appear automatically in the target. A CollectionView can similarly use ItemsSource as a target bound to a List source. section 3.4 section 3.5

Figure 3.15 Each view (target object) can have a single binding context (source object). Properties of the target view are bound to properties of the same type on the source object.

Use the diagram to distinguish the target view from its source object and see how target properties connect to source properties. section 3.4

How .NET MAUI in Action covers it

How deep it goes
Explains source, target, binding context, type matching, and converters, but defers detailed value-converter treatment.
Examples
Uses Entry.Text, UI-to-code bindings, UI-to-UI bindings, and CollectionView.ItemsSource bound to a List.
What it assumes
Assumes basic XAML elements and properties, while introducing binding context, source properties, target properties, and type matching.
What you can do after
Apply it via .NET MAUI data binding to keep target UI properties synchronized with source values.
How it connects
Connects data binding with binding context, target property, value converter, CollectionView, ItemsSource, and DataTemplate.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET MAUI in Action. The section links point to the parts of the book it draws on.