Binding between items inside a DataTemplate

How can I bind the properties of two elements inside a dataTemplate?

example: // Bind Text property for Content property

<DataTemplate>
  <TextBox Text="{Binding}" />
  <Label Content="{Binding}" />
</Datatemplate>
+3
source share
1 answer

If I understood correctly.

<DataTemplate>
<TextBox x:Name="p_text" Text="{Binding login}"/>
<Button Content="{Binding ElementName=p_text, Path Text}"/>
</DataTemplate>
0
source

Source: https://habr.com/ru/post/1768800/


All Articles