What is the use of element name attribute in WPF databinding.
e.g.
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300" Name="win">
<TextBox x:Name="txtData" width="100" height="26" Text={Binding ElementName=win,Mode=TwoWay,Path=Data}/>
<Window>
Regards,
Priyank Thakkar
It’s for binding to another element in your application – see http://msdn.microsoft.com/en-us/library/system.windows.data.binding.elementname.aspx
In your case you are attempting to bind to the
Windowelement with the name win.