using System; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; namespace WpfDatabind1 { /// /// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); Binding bind1 = new Binding(); bind1.Source =textBox1;// ? Set the Source bind1.Path = new PropertyPath( "Text" );// ? Set the Path // Connect the Source and the Target. label1.SetBinding( Label.ContentProperty, bind1 ); label2.SetBinding(Label.ContentProperty, bind1); } private void textBox1_TextChanged(object sender, TextChangedEventArgs e) { // textBox1 is engaged as a source and will throw error //label2.Content = textBox1.Text; } private void textBox2_TextChanged(object sender, TextChangedEventArgs e) { label2.Content = textBox2.Text; } } }