What’s New In Silverlight 3 – Element Binding - Jesse Liberty - Silverlight Geek Page view counter

What’s New In Silverlight 3 – Element Binding

In Silverlight 3 you can now use one User Interface element as the binding object for another. This can greatly simplify your code. For example, if you wish to display the value of a slider in a text box, there is no need to create a data object to mediate their connection; you can bind the text box directly to the slider:

   1: <Slider x:Name="sUnBound"
   2:     LargeChange="10"
   3:     Maximum="100"
   4:     SmallChange="1"
   5:     Value="50"
   6:     VerticalAlignment="Bottom" />
   7:  
   8:  <TextBlock x:Name="valueFromElement"
   9:   Text="{Binding Value, Mode=OneWay, 
  10:        ElementName=sUnBound}" />

 

Putting this in a new application will create a slider and a TextBlock and will bind the latter to the former and no code-behind is required at all.

Much more on this in the Mini-tutorial on Element Binding.

Previous: Easier Easing    Next Multi-Select List Box

Published Wednesday, July 22, 2009 10:41 AM by jesseliberty

Comments

# New and Notable 345

Had extensive sinus surgery Monday and healing all week. There may be few blog posts. Ioc/WCF/WF/Azure Via Jeremy, Introducing the Common Service Factory - IoC and WCF Living in Harmony New walkthroughs for the July CTP of Windows Azure Tools Windows

# What’s New In Silverlight 3 - Multi-Select List Box

n Silverlight 3 the standard ListBox now has a SelectionMode property which is filled from an enumerated

Wednesday, July 22, 2009 2:03 PM by Jesse Liberty - Silverlight Geek

# What's New In Silverlight 3 - Jesse Liberty - Silverlight Geek

Pingback from  What's New In Silverlight 3 - Jesse Liberty - Silverlight Geek

# What’s New In Silverlight 3 - Multi-Select List Box

n Silverlight 3 the standard ListBox now has a SelectionMode property which is filled from an enumerated

Wednesday, July 22, 2009 2:33 PM by Microsoft Weblogs

# ??????????????? 3??? ????????? ??????(??????) &laquo; jin_u as blog

Pingback from  ??????????????? 3??? ????????? ??????(??????) &laquo; jin_u as blog

# Programming with Silverlight, WPF &amp; .NET &raquo; Was ist neu in SL 3?

Pingback from  Programming with Silverlight, WPF &amp; .NET &raquo; Was ist neu in SL 3?