top button
Flag Notify
Site Registration

Explain Different types of Modes in DataBinding??

+2 votes
305 views

Hi frnds any one help what are the different Modes and its types available in databinding in XAML its for wp8 application development......

posted Oct 30, 2014 by Puhal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+2 votes

There are three types of data binding that happens in Silverlight applications between a source and target.

  1. OneTime data binding.
  2. OneWay data binding (default mode)
  3. TwoWay data binding.

1) OneTime – The data is set when Binding is initialized – mostly used in ReadOnly mode.

2) OneWay – Updates data from source to target, so if source changes the target is notified (Default if not specified)

3) TwoWay – Updates data from source to target and vice-versa, so if source changes the target is notified or vice versa.

EXAMPLE:

enter image description here

answer Oct 31, 2014 by Jdk
+1 vote

Here I am not much aware of this but still want to conclude it:

OneWay: use this when you want the data in code-behind to modify the value in your GUI
TwoWay: use this if you want to allow code-behind to modify the GUI value, or if you want the GUI value changed by the user to be reflected in code-behind
OneTime: your code-behind can set the value that is shown in your GUI once, and it will never change again. Only do this if you know you're not going to need to change the value in your code-behind.
OneWayToSource: This is the opposite of one way -- GUI value affects code behind value.
If you don't specify anything, then the behavior will depend on the control that you are using.

For More: http://www.scottlogic.com/blog/2012/04/20/everything-you-wanted-to-know-about-databinding-in-wpf-silverlight-and-wp7-part-two.html

answer Oct 30, 2014 by Amit Kumar Pandey
...