15.13. Element to Element Binding

In Silverlight 3.0 and WPF 4.0, you can now bind directly to another element. This example binds a TextBlock's Text property to the Text property of the text box txtValue:

<TextBox x:Name="txtValue" Width="200" Canvas.Top="50" ></TextBox>
<TextBlock Text="{Binding Text, ElementName=txtValue}"></TextBlock>

Get Introducing .NET 4.0: with Visual Studio 2010 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.