Let\'s say in some abstract ViewModel base-class I have a plain-old property as follows:
public Size Size
{
get { return _size; }
set
{
_size
You can simply override OnPropertyChanged in the derived ViewModel like so:
protected override void OnPropertyChanged(string propertyName) {
base.OnPropertyChanged(propertyName);
if (propertyName == "Size") {
base.OnPropertyChanged("Rectangle");
}
}
Another possibility... A while back I put together a pretty nice ViewModel base class that supports attributes on properties like:
[DependsOn("Size")]
public Rect Rectangle {
get { new Rect(0,0,Size.Width, Size.Height); }
}
Then the ViewModel base class collects these DependsOnAttribute's at runtime and in its OnPropertyChanged method it basically just looks to see what other properties need to be invalidated when a property change occurs.