Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Data binding: One vs two way [closed]

I don't currently have an example for my question. I would just like to get some insight of the following : When should one use one or two way data binding in XAML ?

Thank you in advance for the time you take to answer this !

like image 459
Kevin Avignon Avatar asked Sep 07 '25 15:09

Kevin Avignon


1 Answers

In summary: use OneWay if the property is readonly, use TowWay if you want to change it from your view.

  • TwoWay updates the target property or the property whenever either the target property or the source property changes.
  • OneWay updates the target property only when the source property changes.

REF:Binding.Mode Property. and BindingMode Enumeration

like image 62
Bolu Avatar answered Sep 10 '25 08:09

Bolu