Data binding
There are also a number of performance improvements that we can make when data binding in our applications. The simplest of which can be obtained by simply setting the Binding.Mode
property correctly. In order to make data binding possible, the Framework attaches handlers to listen out for changes to our data bound properties.
For two-way bindings, event handlers will be attached to the PropertyChanged
event of the INotifyPropertyChanged
interface to listen to changes in our data model objects or View Models and to various other XxxChanged
events in the relevant binding target controls to listen to UI-based property changes.
When we only require one way bindings, we can save some computing resources by setting the Mode
property of the Binding
class to the appropriate member of the BindingMode
enumeration. If you remember, when a data bound property is for display purposes only, we should set its Mode
property to OneWay
and when we have no need to update an editable field from...