<Window.Resources> <l:test x:Key="ThisTest" x:Name="MyTest"/> </Window.Resources> <TextBox Text="{Binding ElementName=MyTest, Path=k, Mode=TwoWay}" Name="label1" /> <TextBox Text="{Binding ElementName=MyTest, Path=k, Mode=TwoWay}"Name="label2" /> 

I expected from the code that when I write text in one textbox, it will appear as a friend.

    1 answer 1

    No, this will not work, ElementName not looking for resources.

    For example, do this:

     <TextBox х:Name="label1"/> <TextBox Text="{Binding Text, ElementName=label1, Mode=TwoWay}" x:Name="label2"/>