Skip to content

Commit

Permalink
Fixing Issue #159 Docking manager in TabControl can cause InvalidOper…
Browse files Browse the repository at this point in the history
…ationException
  • Loading branch information
Dirkster99 committed May 8, 2020
1 parent 7c74240 commit af76686
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions source/Components/AvalonDock/DockingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1349,8 +1349,17 @@ public bool AllowMixedOrientation
/// <inheritdoc/>
bool IOverlayWindowHost.HitTest(Point dragPoint)
{
var detectionRect = new Rect(this.PointToScreenDPIWithoutFlowDirection(new Point()), this.TransformActualSizeToAncestor());
return detectionRect.Contains(dragPoint);
try
{
var detectionRect = new Rect(this.PointToScreenDPIWithoutFlowDirection(new Point()), this.TransformActualSizeToAncestor());
return detectionRect.Contains(dragPoint);
}
catch
{
// Silently swallow exception that may occur if DockingManager is not visible (because its hidden by a tab)
}

return false;
}

/// <inheritdoc/>
Expand Down

0 comments on commit af76686

Please sign in to comment.