Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -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
Expand All @@ -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 )
Expand All @@ -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 );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public GridLength DockWidth
}
set
{
if( DockWidth != value )
if( DockWidth != value && value.Value > 0 )
{
RaisePropertyChanging( "DockWidth" );
_dockWidth = value;
Expand All @@ -74,7 +74,7 @@ public GridLength DockHeight
}
set
{
if( DockHeight != value )
if( DockHeight != value && value.Value > 0 )
{
RaisePropertyChanging( "DockHeight" );
_dockHeight = value;
Expand Down