diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableTabItem.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableTabItem.cs index 743e02656..0d38e6581 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableTabItem.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableTabItem.cs @@ -181,7 +181,8 @@ protected override void OnMouseEnter( MouseEventArgs e ) { base.OnMouseEnter( e ); - if( _draggingItem != this && + if( _draggingItem != null && + _draggingItem != this && e.LeftButton == MouseButtonState.Pressed ) { var model = Model; diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutGridControl.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutGridControl.cs index 0f8960d69..cb1c18536 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutGridControl.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutGridControl.cs @@ -416,7 +416,8 @@ private void OnSplitterDragCompleted( object sender, System.Windows.Controls.Pri else { var width = ( prevChildModel.DockWidth.IsAuto ) ? prevChildActualSize.Width : prevChildModel.DockWidth.Value; - prevChildModel.DockWidth = new GridLength( width + delta, GridUnitType.Pixel ); + var resizedWidth = width + delta; + prevChildModel.DockWidth = new GridLength( double.IsNaN(resizedWidth) ? width : resizedWidth, GridUnitType.Pixel ); } if( nextChildModel.DockWidth.IsStar ) @@ -426,7 +427,8 @@ private void OnSplitterDragCompleted( object sender, System.Windows.Controls.Pri else { var width = ( nextChildModel.DockWidth.IsAuto ) ? nextChildActualSize.Width : nextChildModel.DockWidth.Value; - nextChildModel.DockWidth = new GridLength( width - delta, GridUnitType.Pixel ); + var resizedWidth = width - delta; + nextChildModel.DockWidth = new GridLength( double.IsNaN(resizedWidth) ? width : resizedWidth, GridUnitType.Pixel ); } } else @@ -438,7 +440,8 @@ private void OnSplitterDragCompleted( object sender, System.Windows.Controls.Pri else { var height = ( prevChildModel.DockHeight.IsAuto ) ? prevChildActualSize.Height : prevChildModel.DockHeight.Value; - prevChildModel.DockHeight = new GridLength( height + delta, GridUnitType.Pixel ); + var resizedHeight = height + delta; + prevChildModel.DockHeight = new GridLength( double.IsNaN(resizedHeight) ? height : resizedHeight, GridUnitType.Pixel ); } if( nextChildModel.DockHeight.IsStar ) @@ -448,7 +451,8 @@ private void OnSplitterDragCompleted( object sender, System.Windows.Controls.Pri else { var height = ( nextChildModel.DockHeight.IsAuto ) ? nextChildActualSize.Height : nextChildModel.DockHeight.Value; - nextChildModel.DockHeight = new GridLength( height - delta, GridUnitType.Pixel ); + var resizedHeight = height - delta; + nextChildModel.DockHeight = new GridLength( double.IsNaN(resizedHeight) ? height : resizedHeight, GridUnitType.Pixel ); } } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutPositionableGroup.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutPositionableGroup.cs index 9818face0..91d3e5ec2 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutPositionableGroup.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutPositionableGroup.cs @@ -50,7 +50,7 @@ public GridLength DockWidth } set { - if( DockWidth != value ) + if( DockWidth != value && value.Value > 0 ) { RaisePropertyChanging( "DockWidth" ); _dockWidth = value; @@ -74,7 +74,7 @@ public GridLength DockHeight } set { - if( DockHeight != value ) + if( DockHeight != value && value.Value > 0 ) { RaisePropertyChanging( "DockHeight" ); _dockHeight = value;