title: Is it possible to use attributes to automatically raise an event on a property change
body: <p>I find myself writing this code a lot:</p>
  
  <pre><code>    private int _operationalPlan;
      public int OperationalPlan
      {
          get
          {
              return _operationalPlan;
          }
          set
          {
              _operationalPlan = value;
              RaisePropertyChanged();
          }
      }
  
      private void RaisePropertyChanged()
      {
          if (PropertyChanged != null)
          {
              PropertyChanged(this, new
                                        PropertyChangedEventArgs("PlansSelected"));
          }
      }
  </code></pre>
  
  <p>I'm wondering whether it might be possible to write an attribute that could be added to the property to automatically raise the event. I.e. something like this:</p>
  
  <pre><code>[RaiseOnSet("ProperyChanged", "PropertyChangedEventArgs", "PlansSelected")]
  public int OperationalPlan
  {
      get
      {
          return _operationalPlan;
      }
      set
      {
          _operationalPlan = value;
          RaisePropertyChanged();
      }
  }
  </code></pre>
  
  <p>Before I go and try to implement this I was wondering:</p>
  
  <ul>
  <li>Is this facility in the .net framework</li>
  <li>Has anyone tried to this facility</li>
  <li>If it's possible</li>
  <li>If there are any dead ends that I should avoid</li>
  </ul>