diff --git a/source/Components/AvalonDock/Controls/LayoutGridControl.cs b/source/Components/AvalonDock/Controls/LayoutGridControl.cs index 8a2e5a08..1d896730 100644 --- a/source/Components/AvalonDock/Controls/LayoutGridControl.cs +++ b/source/Components/AvalonDock/Controls/LayoutGridControl.cs @@ -600,10 +600,6 @@ public virtual void AdjustFixedChildrenPanelSizes(Size? parentSize = null) { child.AdjustFixedChildrenPanelSizes(availableSize); } - - // #81 - Make parents update their children up the tree. Otherwise, they will not be redrawn. - if (parentSize == null) - _model.RaiseChildrenTreeChanged(); } private FrameworkElement GetNextVisibleChild(int index) diff --git a/source/Components/AvalonDock/Layout/LayoutGroup.cs b/source/Components/AvalonDock/Layout/LayoutGroup.cs index ca600071..9f15d2c6 100644 --- a/source/Components/AvalonDock/Layout/LayoutGroup.cs +++ b/source/Components/AvalonDock/Layout/LayoutGroup.cs @@ -268,7 +268,17 @@ private void _children_CollectionChanged(object sender, System.Collections.Speci ComputeVisibility(); OnChildrenCollectionChanged(); - NotifyChildrenTreeChanged(ChildrenTreeChange.DirectChildrenChanged); + + if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add) + { + // #81 - Make parents update their children up the tree. Otherwise, they will not be redrawn. + RaiseChildrenTreeChanged(); + } + else + { + NotifyChildrenTreeChanged(ChildrenTreeChange.DirectChildrenChanged); + } + RaisePropertyChanged("ChildrenCount"); }