Skip to content

Docking manager in TabControl can cause InvalidOperationException #159

@drapka

Description

@drapka

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]
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions