Articles → WPF → Binding property of one element to other

Binding property of one element to other











<Grid>
	<Grid.ColumnDefinitions>
		<ColumnDefinition></ColumnDefinition>
		<ColumnDefinition></ColumnDefinition>
	</Grid.ColumnDefinitions>
	<Button Content="Test" Background="Red" x:Name="Button1"></Button>
	<TextBox Name="TextBox1" Grid.Column="1"></TextBox>
</Grid>




  Property_Name = "{Binding ElementName=Control_Name, Path=Control_Property}"




    <TextBox Name="TextBox1" Grid.Column="1" Text="{Binding ElementName=Button1, Path=Content}"/>





Click to Enlarge



<TextBox Name="TextBox1" Grid.Column="1">
	<TextBox.Text>
		<Binding ElementName="Button1" Path="Content"></Binding>
	</TextBox.Text>
</TextBox>





Posted By  -  Karan Gupta
 
Posted On  -  Thursday, December 23, 2010

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250