Element to Element Binding in Silverlight

来源:互联网 发布:实况2017球员数据 编辑:程序博客网 时间:2024/06/08 11:59

In the old days, if you want a TextBlock to display the Silder value, you can use two ways,

 

1. Create a business object to hold the Silder Value and then bind it to the TextBlock objec.

2. You can write some code in the Slider value changed event handler to update the value in the TextBlock

 

But if there are more Sliders and more TextBlocks need to do the same thing, neither of above ways is an easy way.

 

Fortunately, we can use the "Element to Element Binding" feature in Silverlight. The Syntax is as follows,

 

 

You can only bind the element which on the page. I tried to bind the element which i created by code, but not working...

原创粉丝点击