protected void Refresh() { // Remove existing children and attached properties foreach (var child in children.DepthFirst(x => x.Children)) { child.Dispose(); } children.Clear(); AttachedProperties.Clear(); // And recompute them from the current value. factory.CreateChildren(this, ParentingNode, PropertyProvider); }