diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorablePaneGroupControl.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorablePaneGroupControl.cs index 0b7769bc2..c0ec4b460 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorablePaneGroupControl.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorablePaneGroupControl.cs @@ -43,7 +43,7 @@ protected override void OnFixChildrenDockLengths() for (int i = 0; i < _model.Children.Count; i++) { var childModel = _model.Children[i] as ILayoutPositionableElement; - if (!childModel.DockWidth.IsStar) + if (childModel.ForceFixedDockSize && !childModel.DockWidth.IsStar) { childModel.DockWidth = new GridLength(1.0, GridUnitType.Star); } @@ -54,7 +54,7 @@ protected override void OnFixChildrenDockLengths() for (int i = 0; i < _model.Children.Count; i++) { var childModel = _model.Children[i] as ILayoutPositionableElement; - if (!childModel.DockHeight.IsStar) + if (childModel.ForceFixedDockSize && !childModel.DockHeight.IsStar) { childModel.DockHeight = new GridLength(1.0, GridUnitType.Star); } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentPaneGroupControl.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentPaneGroupControl.cs index e9b368f5f..cba3e8458 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentPaneGroupControl.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentPaneGroupControl.cs @@ -42,7 +42,7 @@ protected override void OnFixChildrenDockLengths() for (int i = 0; i < _model.Children.Count; i++) { var childModel = _model.Children[i] as ILayoutPositionableElement; - if (!childModel.DockWidth.IsStar) + if (childModel.ForceFixedDockSize && !childModel.DockWidth.IsStar) { childModel.DockWidth = new GridLength(1.0, GridUnitType.Star); } @@ -53,7 +53,7 @@ protected override void OnFixChildrenDockLengths() for (int i = 0; i < _model.Children.Count; i++) { var childModel = _model.Children[i] as ILayoutPositionableElement; - if (!childModel.DockHeight.IsStar) + if (childModel.ForceFixedDockSize && !childModel.DockHeight.IsStar) { childModel.DockHeight = new GridLength(1.0, GridUnitType.Star); } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutPanelControl.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutPanelControl.cs index d71bc3ee1..c3e29f818 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutPanelControl.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutPanelControl.cs @@ -52,24 +52,24 @@ protected override void OnFixChildrenDockLengths() var childContainerModel = _model.Children[i] as ILayoutContainer; var childPositionableModel = _model.Children[i] as ILayoutPositionableElement; - if (childContainerModel != null && - (childContainerModel.IsOfType() || - childContainerModel.ContainsChildOfType())) + if (childPositionableModel.ForceFixedDockSize) { - childPositionableModel.DockWidth = new GridLength(1.0, GridUnitType.Star); - } - else if (childPositionableModel != null && childPositionableModel.DockWidth.IsStar) - { - var childPositionableModelWidthActualSize = childPositionableModel as ILayoutPositionableElementWithActualSize; - - var widthToSet = Math.Max(childPositionableModelWidthActualSize.ActualWidth, childPositionableModel.DockMinWidth); - - widthToSet = Math.Min(widthToSet, ActualWidth / 2.0); - widthToSet = Math.Max(widthToSet, childPositionableModel.DockMinWidth); - - childPositionableModel.DockWidth = new GridLength( - widthToSet, - GridUnitType.Pixel); + if (childContainerModel != null && + (childContainerModel.IsOfType() || + childContainerModel.ContainsChildOfType())) { + childPositionableModel.DockWidth = new GridLength(1.0, GridUnitType.Star); + } else if (childPositionableModel != null && childPositionableModel.DockWidth.IsStar) { + var childPositionableModelWidthActualSize = childPositionableModel as ILayoutPositionableElementWithActualSize; + + var widthToSet = Math.Max(childPositionableModelWidthActualSize.ActualWidth, childPositionableModel.DockMinWidth); + + widthToSet = Math.Min(widthToSet, ActualWidth / 2.0); + widthToSet = Math.Max(widthToSet, childPositionableModel.DockMinWidth); + + childPositionableModel.DockWidth = new GridLength( + widthToSet, + GridUnitType.Pixel); + } } } } @@ -78,7 +78,7 @@ protected override void OnFixChildrenDockLengths() for (int i = 0; i < _model.Children.Count; i++) { var childPositionableModel = _model.Children[i] as ILayoutPositionableElement; - if (!childPositionableModel.DockWidth.IsStar) + if (childPositionableModel.ForceFixedDockSize && !childPositionableModel.DockWidth.IsStar) { childPositionableModel.DockWidth = new GridLength(1.0, GridUnitType.Star); } @@ -94,21 +94,21 @@ protected override void OnFixChildrenDockLengths() var childContainerModel = _model.Children[i] as ILayoutContainer; var childPositionableModel = _model.Children[i] as ILayoutPositionableElement; - if (childContainerModel != null && - (childContainerModel.IsOfType() || - childContainerModel.ContainsChildOfType())) + if (childPositionableModel.ForceFixedDockSize) { - childPositionableModel.DockHeight = new GridLength(1.0, GridUnitType.Star); - } - else if (childPositionableModel != null && childPositionableModel.DockHeight.IsStar) - { - var childPositionableModelWidthActualSize = childPositionableModel as ILayoutPositionableElementWithActualSize; - - var heightToSet = Math.Max(childPositionableModelWidthActualSize.ActualHeight, childPositionableModel.DockMinHeight); - heightToSet = Math.Min(heightToSet, ActualHeight / 2.0); - heightToSet = Math.Max(heightToSet, childPositionableModel.DockMinHeight); - - childPositionableModel.DockHeight = new GridLength(heightToSet, GridUnitType.Pixel); + if (childContainerModel != null && + (childContainerModel.IsOfType() || + childContainerModel.ContainsChildOfType())) { + childPositionableModel.DockHeight = new GridLength(1.0, GridUnitType.Star); + } else if (childPositionableModel != null && childPositionableModel.DockHeight.IsStar) { + var childPositionableModelWidthActualSize = childPositionableModel as ILayoutPositionableElementWithActualSize; + + var heightToSet = Math.Max(childPositionableModelWidthActualSize.ActualHeight, childPositionableModel.DockMinHeight); + heightToSet = Math.Min(heightToSet, ActualHeight / 2.0); + heightToSet = Math.Max(heightToSet, childPositionableModel.DockMinHeight); + + childPositionableModel.DockHeight = new GridLength(heightToSet, GridUnitType.Pixel); + } } } } @@ -117,7 +117,7 @@ protected override void OnFixChildrenDockLengths() for (int i = 0; i < _model.Children.Count; i++) { var childPositionableModel = _model.Children[i] as ILayoutPositionableElement; - if (!childPositionableModel.DockHeight.IsStar) + if (childPositionableModel.ForceFixedDockSize && !childPositionableModel.DockHeight.IsStar) { childPositionableModel.DockHeight = new GridLength(1.0, GridUnitType.Star); } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/ILayoutPositionableElement.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/ILayoutPositionableElement.cs index 34027fe95..a877a10bd 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/ILayoutPositionableElement.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/ILayoutPositionableElement.cs @@ -42,6 +42,7 @@ GridLength DockHeight bool AllowDuplicateContent { get; set; } bool IsVisible { get; } + bool ForceFixedDockSize { get; } } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutPositionableGroup.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutPositionableGroup.cs index 8257d7f38..217af52c9 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutPositionableGroup.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutPositionableGroup.cs @@ -76,7 +76,29 @@ public GridLength DockHeight } protected virtual void OnDockHeightChanged() - { + { + + } + + bool _forceFixedDockSize; + public bool ForceFixedDockSize + { + get { + return _forceFixedDockSize; + } + set { + if (ForceFixedDockSize != value) { + RaisePropertyChanging("ForceFixedDockSize"); + _forceFixedDockSize = value; + RaisePropertyChanging("ForceFixedDockSize"); + + OnForceFixedDockSizeChanged(); + } + } + } + + protected virtual void OnForceFixedDockSizeChanged() + { }