title: How to data-bind a label
body: <p>How to bind the content of a label to the class2 property <code>PropName</code>?<br>
  Class2 is not directly being used in <code>Mainwindlow.xmal.cs</code>.</p>
  
  <p><code>Class1</code> is being used in <code>Mainwindow.xmal.cs</code><br>
  And <code>Class2</code> is being used in <code>Class1</code>.<br>
  Here is the code I'm using:  </p>
  
  <pre><code>class Class2:INotifyPropertyChanged
  {
      string _PropName;
      public string PropName
      {
          get
          {
              return this._PropName;
          }
          set
          {
              this._PropName = value;
              OnPropertyChanged("PropName");
          }
      }
      private void OnPropertyChanged(string p)
      {
          if (PropertyChanged != null)
              PropertyChanged.Invoke(this, new PropertyChangedEventArgs(p));
      }
      public event PropertyChangedEventHandler PropertyChanged;
  }
  public partial class MainWindow : Window,INotifyPropertyChanged
  {
      Class1 class1ob;
      public MainWindow()
      {            
          InitializeComponent();
          class1ob = new Class1();          
      }
      private void button1_Click(object sender, RoutedEventArgs e)
      {
          class1ob.changeProp();            
      }
  }
  </code></pre>
  
  <p>I want to bind the content of a label eith the <code>Class2</code> property - <code>PropName</code>.<br>
  How can I do that?</p>