by jesseliberty via Jesse Liberty - Silverlight Geek on 7/22/2009 2:41:00 PM
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
Original Post: What’s New In Silverlight 3 – Element Binding
The content of the postings is owned by the respective author. Silverlight Feeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on Silverlight Feeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.