RestoreLayout and floating windows

Jan 15, 2009 at 9:56 AM
I might be doing something wrong here, but I have a DocumentPane with a couple of DockableContents in it.  If I save the layout and then drag one of the contents out so it's floating and then try and restore the layout the program falls over in the InsertChildRelativeTo method of the ReszingPanel class, it seems that the childToInsert parameter is being passed as null.  Is there something I should be doing to avoid this error ?  My xaml is below, many thanks in advance.

 

 

<Grid>

 

 

 

<Grid.RowDefinitions>

 

 

 

<RowDefinition Height="26" />

 

 

 

<RowDefinition />

 

 

 

</Grid.RowDefinitions>

 

 

 

 

<StackPanel Orientation="Horizontal" Grid.Row="0">

 

 

 

<Button x:Name="btnSaveLayout" Content="Save" Click="btnSaveLayout_Click" />

 

 

 

<Button x:Name="btnLoadLayout" Content="Load" Click="btnLoadLayout_Click" />

 

 

 

</StackPanel>

 

 

 

 

<Dock:DockingManager x:Name="dmMainDoc" Grid.Row="1">

 

 

 

<Dock:ResizingPanel Orientation="Horizontal">

 

 

 

<Dock:ResizingPanel Orientation="Vertical">

 

 

 

<Dock:DockablePane>

 

 

 

<Dock:DockableContent x:Name="Companies">

 

 

 

 

</Dock:DockableContent>

 

 

 

</Dock:DockablePane>

 

 

 

<Dock:DockablePane>

 

 

 

<Dock:DockableContent x:Name="Contacts">

 

 

 

 

</Dock:DockableContent>

 

 

 

</Dock:DockablePane>

 

 

 

</Dock:ResizingPanel>

 

 

 

<Dock:DocumentPane>

 

 

 

<Dock:DockableContent x:Name="Order1" Title="Order1">

 

 

 

</Dock:DockableContent>

 

 

 

<Dock:DockableContent x:Name="Order2" Title="Order2">

 

 

 

</Dock:DockableContent>

 

 

 

</Dock:DocumentPane>

 

 

 

</Dock:ResizingPanel>

 

 

 

</Dock:DockingManager>

 

 

 

</Grid>