In this article you will learn how to create data binding in Universal Windows Platform.

What is Data Binding?

Data binding is a technique used to make an item dependent to another item. Eitherthe source (User) is dependent on the target (Server) or the target is dependent onthe source or both are dependent on each other.

The change in one item will also change the second item.

Data Binding Types
  1. One way binding: Only one item is dependent on the other item.
  2. Two way binding: Both first and the second items are dependent on each other.

In logical words, in one-way binding, the server can change the user form or whatever the user is accessing, while in two-way binding both can access each other, whatever they are accessing.

Here in this example we are going to implement just one-way binding, we will also talk about two-way binding in the next tutorial.

Example

In this example we will make a slider in our "MainPage.xaml" and one image. We will bind image height with the slider. As we will increase slider volume the height of picture will be increased accordingly. So, let's start with the new project.

Output

On increasing the Slider value.

Output

On decreasing the value of slider.

slider

So, as we increase the slider value the greater will be the image height. We bind the image height with the slider value.

Read more articles on Universal Windows Apps: