protected virtual void NotifyChildPropertyChanging(string propertyName, object sender, PropertyChangingEventArgs e) { ChildPropertyChangingEventHandler handler = ChildPropertyChanging; if (handler != null) { handler(sender, new ChildPropertyChangingEventArgs(this, propertyName, sender, e)); } }
protected virtual void NotifyChildPropertyChanging(string propertyName, object sender, PropertyChangingEventArgs e) { ChildPropertyChangingEventHandler handler = ChildPropertyChanging; if (handler != null) { handler(sender, new ChildPropertyChangingEventArgs(this, propertyName, sender, e)); } if (propertyName == PROPERTIES.CHILDREN) { NotifyPropertyChanging(PROPERTIES.COMP_SUB); NotifyPropertyChanging(PROPERTIES.COMP_SUB_CACHED); } else if (propertyName == PROPERTIES.PS) { string path = (e is ChildPropertyChangingEventArgs ? ((ChildPropertyChangingEventArgs)e).FullPath : e.PropertyName); if (path == ModelUtils.NameOfProperty((MyClass o) => o.P)) { NotifyPropertyChanging(PROPERTIES.COMP_SUB); } else if (path == ModelUtils.NameOfProperty((MyClass o) => o.P.X)) { NotifyPropertyChanging(PROPERTIES.COMP_SUB_CACHED); } } else if (propertyName == PROPERTIES.P) { string path = (e is ChildPropertyChangingEventArgs ? ((ChildPropertyChangingEventArgs)e).FullPath : e.PropertyName); if (path == ModelUtils.NameOfProperty((Point o) => o.X)) { NotifyPropertyChanging(PROPERTIES.COMP_SUB); NotifyPropertyChanging(PROPERTIES.COMP_SUB_CACHED); } else if (path == ModelUtils.NameOfProperty((Point o) => o.Y)) { NotifyPropertyChanging(PROPERTIES.COMP_SUB); NotifyPropertyChanging(PROPERTIES.COMP_SUB_CACHED); } } }