Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit c1a14a4

Browse files
hpsadgrunwald
authored andcommitted
Fix exception when changing AvalonDock panes size during auto-layout change
1 parent 3de4c13 commit c1a14a4

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/Libraries/AvalonDock/AvalonDock/ResizingPanel.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,10 @@ void splitter_DragDelta(object sender, DragDeltaEventArgs e)
882882
//Point draggedPoint = this.PointToScreenDPI(
883883
// new Point(e.HorizontalChange, e.VerticalChange));
884884
Window wnd = Window.GetWindow(this);
885+
if (wnd == null)
886+
{
887+
return;
888+
}
885889
var trToWnd = TransformToAncestor(wnd);
886890
Vector transformedDelta = trToWnd.Transform(new Point(e.HorizontalChange, e.VerticalChange)) -
887891
trToWnd.Transform(new Point());
@@ -1172,6 +1176,11 @@ void splitter_DragCompleted(object sender, DragCompletedEventArgs e)
11721176

11731177
Size[] currentSizes = new Size[visibleChildren.Count];
11741178
Window wnd = Window.GetWindow(this);
1179+
if (wnd == null)
1180+
{
1181+
InvalidateMeasure();
1182+
return;
1183+
}
11751184
var trToWnd = TransformToAncestor(wnd).Inverse;
11761185
Vector transformedDelta = trToWnd.Transform(new Point(e.HorizontalChange, e.VerticalChange)) -
11771186
trToWnd.Transform(new Point());

0 commit comments

Comments
 (0)