Skip to content

Save/Load DockLayout BUG  #18

@santoxyz

Description

@santoxyz

Sometimes, when you dockControl.Save(); your current layout (i.e. you have two left side panels one on top of the other) the saved XAML contains some unexpected ShowAsFloatingAction members.

When you subsequently try to dockControl.Load() your saved layout a debug assert is thrown from DockManager.WindowHandler.cs:

private void InitNativeStrategy()
{
Debug.Assert(DockControl.FloatingWindows.Count == 0);
DockControl.FloatingWindows.CollectionChanged += new NotifyCollectionChangedEventHandler(OnFloatingWindowsChanged);
}

If you ignore it and continue, whenever you try to change the dockitems layout moving around panels, the app crashes with a NullReferenceExeption:

private void ShowOverlayWindow()
{
_overlayWindow = OverlayWindow.Show(DockControl);
SetStartMousePosition(_overlayWindow, _overlayWindow.PointFromScreen(_startMousePoint));
foreach (FloatingWindow floatingWindow in DockControl.FloatingWindows)
{
NativeFloatingWindow nativeWindow = NativeFloatingWindow.GetNativeFloatingWindow(floatingWindow); //NativeFloatingWindow is null
SetStartMousePosition(nativeWindow, nativeWindow.PointFromScreen(_startMousePoint));
}
}

Anybody knows how to solve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions