Autoraise PropertyChanged event on calculated properties

Mar 3, 2014 at 11:38 AM
Edited Mar 3, 2014 at 11:40 AM
I really like this solution for raising the PropertyChanged event if another value of a calculated property has changed

https://github.com/mattdot/catwalk#calculated-properties
Calculated properties are read-only properties that are computed based on other observable properties. The Observable Model base class raises a PropertyChanged event for calculated properties when the referenced properties change.
public class SampleModel : ObservableModel
{
  public string FirstName
  {
    get { return GetValue<string>(); }
    set { SetValue(value); }
  }

  public string LastName
  {
    get { return GetValue<string>(); }
    set { SetValue(value); }
  }

  public string FullName
  {
    get
    {
      return Calculated(() => this.FirstName + " " + this.LastName);
    }
  }
}
Wouldn't it be neat to implement this also for MVVM light?