Tuesday, August 16, 2011

RelativeSource Binding in Silverlight

Sometime we need to bind the same data in different properties of the same control. For example, in some cases we need to show text in a TextBlock and also want to show the same text as a Tooltip to that TextBlock control.   How to do it? It's very easy to bind the same value twice in the control. But is there any other way to implement the same? Let us discuss this today in this blog post. If you are not aware of it till date, you will definitely like.     Let us discuss the common way to implement this. As we discussed we can bind data in multiple properties of the same control like this:   <TextBlock Text="{Binding Information, ElementName=userControl}" ToolTipService.ToolTip="{Binding Information, ElementName=userControl}" HorizontalAlignment="Center" VerticalAlignment="Center"/>   If you want to do this in similar way, you have to define a...



Like Us On Facebook and Receive All Updates!

You can also receive Free Email Updates:

Powered By Tutorails