title: Listening to PropertyChanged from another class
body: <p>How can I listen in class B to the <code>PropertyChanged</code> events from class A? I would like to listen to changes of a property from class A.</p>
  <pre><code>class A : INotifyPropertyChanged
  {
          private int _x;
  
          public int X
          {
              get =&gt; _x;
              set
              {
                  if (_x == value) return;
                  _x = value;
                  OnPropertyChanged(nameof(X));
              }
          }
  
          public event PropertyChangedEventHandler PropertyChanged;
  
          protected virtual void OnPropertyChanged(string propertyName)
          {
              PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
          }
  }
  
  class B
  {
          public B(int x)
          {
              // In this class I want to listen to changes of the property X from class A
          }
  }
  </code></pre>