Saturday, June 25, 2011

Windows Phone Sauce Developer Lab : Intro To Data Binding And Events




This is how we display the text we don’t want the user to change it directly. But what if we want to change this text over time? Here is a simple example on how you can change the text through an input mechanism.

1) Continue with the previous project



2) Now rearrange the xaml code and add a text box:



Alternative method using drag and drop which is way easier is shown in the video.



3) Now our intention is to enter some text in textbox and when we click the button, the textBlock’s text should change to what we entered. Here we will do a little bit of data binding.



4) Double Click on the button and modify the code as follows:




In this event of clicking the button, the text of textBlock will change to text in textbox.
5) Check it out by debugging the application in exactly the same way you did in Hello World application.



Now before we move to something else, how about exploring little bit around? Check out all of this and a LOT more in the video this article follows.




By Shantanu Pandey

    • Popular
    • Categories
    • Archives

     
    Web Analytics