title: C# DataBinding - automatically writing changed property to label or textbox
body: <p>I read some about DataBinding, mostly complicated things like SQL or whatever XAML and stuff.
  All I want my programm to do is, if the "value" of a variable changes just write it in a textbox or label. (using WindowsForms)</p>
  
  <p>So far what I have:</p>
  
  <pre><code>namespace DataBinding_Test
  {
      public partial class Form1 : Form
      {
  
      BindingSource bs = new BindingSource();
      Class1 test = new Class1();
  
      public Form1()
      {
          InitializeComponent();
  
          test.name = "Hello";
          bs.DataSource = test;
  
          label1.DataBindings.Add(new Binding("Text", bs, "name", false, DataSourceUpdateMode.OnPropertyChanged));
  
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
          test.name = textBox1.Text;
      }
    }
  }
  </code></pre>
  
  <p>Class1 just has a public property name. On startup lable1 will show my "Hello" string. Then on button click the name property will change. On debug I saw the actual DataSource of "bs" contains the new property value, but the label will not show anything...</p>
  
  <p>Is there any realtivly easy way to do this?</p>
  
  <p>The Backround is: periodically there will be a polling of sensor data throug RS232. If the value of one sensor changes I want to show this in label or textbox. Now a backroundthreaded timer will need invokes and stuff to access the GUI thread; thought this would be easier with databinding but seems not :P</p>
  
  <p>Thanks to all, great site, great work! :)</p>