title: How to bind local property on control in WPF
body: <p>I have two controls on WPF</p>
  <pre><code>&lt;Button HorizontalAlignment=&quot;Center&quot;
          Name=&quot;btnChange&quot;
          Click=&quot;btnChange_Click&quot;
          Content=&quot;Click Me&quot; /&gt;
  
  &lt;Label Name=&quot;lblCompanyId&quot;
         HorizontalAlignment=&quot;Center&quot;
         DataContext=&quot;{Binding ElementName=_this}&quot;
         Content=&quot;{Binding Path=CompanyName}&quot; /&gt;
  </code></pre>
  <p>As we can see that label is bound to local property(in code Behind), I don't see any value on label when I click button...</p>
  <p>Below is my code behind...</p>
  <pre><code>public static readonly DependencyProperty CompanyNameProperty =
    DependencyProperty.Register(&quot;CompanyName&quot;, typeof(string), typeof(Window3), new UIPropertyMetadata(string.Empty));
  
  public string CompanyName {
    get { return (string)this.GetValue(CompanyNameProperty); }
    set { this.SetValue(CompanyNameProperty, value); }
  }
  
  private void btnChange_Click(object sender, RoutedEventArgs e) {
    this.CompanyName = &quot;This is new company from code beind&quot;;
  }
  </code></pre>