Dirkster99/AvalonDock

Docking manager in TabControl can cause InvalidOperationException

drapka opened this issue · 1 comments

Hi,
I have a DockingManager component in a tabcontrol. Floating windows in this manager automatically appear after app start even when the tab with the docking manager is not yet selected, which is cool (Loaded event is called). But there is an issue if I try to drag the floating window before selecting the tab with the docking manager - an InvalidOperationException (This Visual is not connected to a PresentationSource) occurs:

This exception was originally thrown at this call stack:
    [External Code]
    AvalonDock.Controls.TransformExtensions.PointToScreenDPI(System.Windows.Media.Visual, System.Windows.Point) in TransformExtentions.cs
    AvalonDock.Controls.TransformExtensions.PointToScreenDPIWithoutFlowDirection(System.Windows.FrameworkElement, System.Windows.Point) in TransformExtentions.cs
    AvalonDock.DockingManager.AvalonDock.Controls.IOverlayWindowHost.HitTest(System.Windows.Point) in DockingManager.cs
    AvalonDock.Controls.DragService.UpdateMouseLocation.AnonymousMethod__0(AvalonDock.Controls.IOverlayWindowHost) in DragService.cs
    AvalonDock.Controls.DragService.UpdateMouseLocation(System.Windows.Point) in DragService.cs
    AvalonDock.Controls.DragService.Drop(System.Windows.Point, out bool) in DragService.cs
    AvalonDock.Controls.LayoutFloatingWindowControl.FilterMessage(System.IntPtr, int, System.IntPtr, System.IntPtr, ref bool) in LayoutFloatingWindowControl.cs
    AvalonDock.Controls.LayoutDocumentFloatingWindowControl.FilterMessage(System.IntPtr, int, System.IntPtr, System.IntPtr, ref bool) in LayoutDocumentFloatingWindowControl.cs
    [External Code]
    ...

Hi Thanx for the feedback.

The issue is solved (in master branch) and will be part of the next release.

Cheers Drk