SaveLayout and floating windows

Dec 14, 2008 at 2:43 PM
Edited Dec 18, 2008 at 1:38 PM

I trying to save layout with floating window in it.

  <ad:DockingManager x:Name="dockManager">
<ad:ResizingPanel Orientation="Vertical">

<ad:ResizingPanel Orientation="Horizontal">
<ad:DockablePane x:Name="ControlsPane">
<ad:DockableContent x:Name="Controls" DockableStyle="Floating" Title="Toolbox">
<StackPanel Width="Auto" Height="Auto">
<Button Content="Button"/>
<Button Content="Button"/>
<Button Content="Button"/>
</StackPanel>
</ad:DockableContent>
</ad:DockablePane>

           ..other panels..

I start my app, undocking Toolbox and saving layout

After loading back Toolbox is not visible.

In Layout data i have: 

  <Hidden>
<DockableContent Name="Controls" AutoHide="false" />
</Hidden>
Where is the way out?

PS Thanks for great docking library :)

EDIT: Please help me ;(

Dec 20, 2008 at 12:11 PM
Researches revealed that DockablePane after undocking falls into internal array named _hiddenContents not into _floatingWindows.

Anyone got ideas? 

Dec 20, 2008 at 1:50 PM
Edited Dec 20, 2008 at 2:04 PM

Finally i have what i wanted.
But FloatingWindow is not exactly at place where it should be.

There two steps to it:
    1. At Window.Loaded for each hidden pane i call dockManager.Show(content, DockableContentState.FloatingWindow);

    2. Little change in 
                public void Show(DockableContent content, DockableContentState desideredState, AnchorStyle desideredAnchor) of DockingManager
        
        for restore saved position commented out : floatingWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner; 
        in branch corresponding to call parameters.

adospace plz tell me what i'm doing wrong :)

Dec 20, 2008 at 2:15 PM
And there story ends.
If you saving your layout after OnClosed event. DockingManager OnClosed hides any contents.
In that reason any floating windows in my xml layout data always was been in Hidden section.

Solution is simple: forget about changes and save before OnClosed event :)

2adospace:
SaveLayout of DockingManager must throw an exception when called after OnClosed event handler.
And LoadLayout must throw an exception when it is called before main window is showed.