Click here to Skip to main content
15,888,113 members
Articles / Desktop Programming / XAML
Tip/Trick

Simple Data Binding UWP

Rate me:
Please Sign up or sign in to vote.
4.71/5 (6 votes)
1 Dec 2015CPOL 19.2K   2   5
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.

    Image 3

    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/

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Student
Pakistan Pakistan
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionInteresting tip : My vote of 5 Pin
raddevus7-Dec-17 9:29
mvaraddevus7-Dec-17 9:29 
GeneralGreat Article Pin
aarif moh shaikh2-Dec-15 19:12
professionalaarif moh shaikh2-Dec-15 19:12 
GeneralRe: Great Article Pin
Umer Qureshi2-Dec-15 20:29
professionalUmer Qureshi2-Dec-15 20:29 
QuestionGood but not deep enough Pin
Akash Gutha2-Dec-15 16:32
professionalAkash Gutha2-Dec-15 16:32 
AnswerRe: Good but not deep enough Pin
Umer Qureshi2-Dec-15 20:22
professionalUmer Qureshi2-Dec-15 20:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.