From 11e66be6d9d9bbe0a68b376d17439dfc415139b6 Mon Sep 17 00:00:00 2001 From: brianlagunas_cp Date: Mon, 14 Mar 2011 23:24:23 +0000 Subject: [PATCH] PropertyGrid: Fixed column resizing when switching from Categorized to Alphabetized --- .../PropertyGrid/Implementation/PropertyGrid.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs index 9b704854..d17188a6 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs @@ -53,6 +53,7 @@ namespace Microsoft.Windows.Controls.PropertyGrid protected virtual void OnIsCategorizedChanged(bool oldValue, bool newValue) { LoadProperties(newValue); + SetDragThumbMargin(); } #endregion //IsCategorized @@ -104,6 +105,7 @@ namespace Microsoft.Windows.Controls.PropertyGrid _propertyItemsCache = GetObjectProperties(newValue); LoadProperties(IsCategorized); + SetDragThumbMargin(); } #endregion //SelectedObject @@ -365,6 +367,17 @@ namespace Microsoft.Windows.Controls.PropertyGrid } } + private void SetDragThumbMargin() + { + if (_dragThumb == null) + return; + + if (IsCategorized) + _dragThumb.Margin = new Thickness(6, 0, 0, 0); + else + _dragThumb.Margin = new Thickness(-1, 0, 0, 0); + } + #endregion //Methods } }