Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Windows Phone 7 Silverlight Cookbook

You're reading from   Windows Phone 7 Silverlight Cookbook All the recipes you need to start creating apps and making money.

Arrow left icon
Product type Paperback
Published in Aug 2011
Publisher Packt
ISBN-13 9781849691161
Length 304 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Jonathan Marbutt Jonathan Marbutt
Author Profile Icon Jonathan Marbutt
Jonathan Marbutt
Robb Schiefer Robb Schiefer
Author Profile Icon Robb Schiefer
Robb Schiefer
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Element-to-element binding


While we have seen what happens when we bind to a ViewModel in order to get data, there is also the concept of having the ability to bind one control on a screen to another. One of the greatest and most overlooked features in Silverlight is element-to-element binding. This actually means that you can bind any property of any control to a property of another control. We will take a look at how to bind a few different controls to different properties of other controls.

Getting ready

In this example, we are going to stay in Blend the entire time, so let's create a new Windows Phone Application. On the Main Page, drag and drop both a textbox and a slider control. What we are going to do in this example is bind the value of the slider to the textblock.

We also want to go ahead and set the value of the SlideControl to 50 and the Maximum property to 100. This will make your slider control look 50 percent blue.

How to do it...

Now that we have the controls created, we need...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image