title: C# raise event when property changes in foreign class
body: <p>I want to check if property changed in a class which isn't mine and doesn't implement INotifyPropertyChanged. This class is a part of an API and I want to raise event when Name property changes. </p>
  
  <pre><code>class SomethingChanged : INotifyPropertyChanged
  {
      Something sth;
      string Name { get; set; }
      public SomethingChanged(Something Sth)
      {
          sth = Sth;
          Name = sth.Name;
          //do something to allow raise PropertyChangedEvent when sth.Name changes
      }
  
      public event PropertyChangedEventHandler PropertyChanged;
      protected void OnPropertyChanged(string propertyName)
      {
          if (PropertyChanged != null)
              PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
      }
  }
  </code></pre>
  
  <p>I want to use it in WPF by the way (treeView). Is there any way to do that?</p>
  
  <p>Or am I out of luck if that class (Something in example above) doesn't implement INotifyPropertyChanged?</p>