Thursday, February 21, 2019

Types of Data Binding in WPF

Types of Binding

OneWay
TwoWay
OneWayToSource
OneTime


One Way

In this type of binding, data is bound to its source i.e. business model to its target i.e. UI. Whenever type anything in text box it assigned to its property.

Two Way

In this, data is getting updated from both sides i.e. source and target. If there is any change from UI, it updates the business model, and vice versa.


OneWayToSource

OneWayToSource is the reverse of OneWay binding; it updates the source property when the target property changes. It is good for read only text box whenever changes in variable it appear in textbox.

OneTime

This has the same behaviour as OneWay except it will only update the user interface one time. This should be your default choice for binding.

No comments:

Followers

Link