tags:

views:

33

answers:

2

I have a question regarding the binding

I have two textbox, textbox one is bind to the property NAME and has the tag FULLName

< TextBox Name="NewTextBox" Tag="FullName" Text="{Binding Path = Name}" >

In the second textbox I need to bind to the property that is available as the tag on the first textbox.

How to do it in XAML?

A: 

I'm not sure but is this what you're looking for?

<TextBox x:Name="textbox1" Text="{Binding Path=Name}" Tag="{Binding Path=FullName}"/>
<TextBox x:Name="textbox2" Text="{Binding ElementName=textbox1, Path=Tag}"/>
karmicpuppet
A: 
<TextBox Name="NewTextBox" Tag="FullName" Text="{Binding Path=Name}" /> 
<TextBox x:Name="NewTextBox2" Text="{Binding ElementName=NewTextBox, Path=Tag}"/>
sudarsanyes
i want to bind to the Fullname property in the datacontext.But i need to get the property from the tag of the NewTextbox.
Dhyanesh
In such a case, set the data context of the NewTextBox2 to FullName and set the binding path to Tag of the element name. Similar to the snippet that I have mentioned above but the addition would be setting up of the DataContext for NewTextBox2
sudarsanyes