65.9K
CodeProject is changing. Read more.
Home

Simple Data Binding UWP

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.71/5 (6 votes)

Dec 2, 2015

CPOL
viewsIcon

19850

How to bind data in a simple way without writing any code

Introduction

Now, I will explain how to do data binding in a simple way in just a few steps. In this example, we will bind some elements so changing the value of one effects the value of other dynamically.

  • Create a new project and add a slider, textblock and progressbar.

    Adding Controls

  • Now first bind the progressbar with the slider, for this we have to bind the value attribute of progressbar with the value attribute of the slider.

    Binding Progressbar

  • Now also bind the textblock’s text attribute with the slider’s value attribute. After the successful binding, the small indicator will turn into yellow.

    and textblock value will be 0.

    Binding Textblock

  • Now run the project and see the binding in action .

    Binding In Action

Source code: https://github.com/umerqureshi93/SimpleDataBinding

Personal blog: http://csdebugger.blogspot.com/