Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
600
LoadLayout fails when using the result of SaveLayout, includes DocumentHost
posted

I'm sure I'm misusing the XamDockManager but need some guidance. I have the task of persisting the state of all panes and thought using SaveLayout and LoadLayout would serve the purpose.

I've created a sample application with static layout, but my real objective is to make this work in a Prism application with dynamic tabgroup and content panes. But one thing at a time.

In my sample app, on window load I'm calling SaveLayout, which returns an xml string of the saved settings. Next, I'm calling LoadLayout, passing in this xml string. I receive this error:

  • The ContentPane 'Document' is supposed to be positioned as 'Document' but information for that position was not in the layout.

 

The referenced ContentPane is within a DocumentContentHost. Here's the XAML for the XamDockManager and its children. I can also supply the resulting XML from SaveLayout(). This XamDockManager is the only child of a XamRibbonWindow's ContentHost:

<igDock:XamDockManager x:Name="dockManager">
   <igDock:XamDockManager.Panes>
      <igDock:SplitPane x:Name="ExplorerSplit" igDock:XamDockManager.InitialLocation="DockedLeft" Width="225">
         <igDock:TabGroupPane x:Name="ExplorerPane">
            <igDock:ContentPane x:Name="Explorer" IsPinned="True" Header="Explorer" AllowInDocumentHost="False">
               <Button Content="Explorer" IsEnabled="False" />
            </igDock:ContentPane>
         </igDock:TabGroupPane>
      </igDock:SplitPane>
      <igDock:SplitPane x:Name="ListSplit" SplitterOrientation="Vertical" igDock:XamDockManager.InitialLocation="DockedTop" Height="145">
         <igDock:TabGroupPane x:Name="ListPane">
            <igDock:ContentPane x:Name="List" IsPinned="True" Header="List" AllowInDocumentHost="False">
               <Button Content="List" IsEnabled="False" />
            </igDock:ContentPane>
         </igDock:TabGroupPane>
      </igDock:SplitPane>
      <igDock:SplitPane x:Name="DetailSplit" SplitterOrientation="Vertical" igDock:XamDockManager.InitialLocation="DockedRight" Width="270">
         <igDock:TabGroupPane x:Name="DetailPane">
            <igDock:ContentPane x:Name="Detail" IsPinned="True" Header="Detail" AllowInDocumentHost="False">
               <Button Content="Detail" IsEnabled="False" />
            </igDock:ContentPane>
         </igDock:TabGroupPane>
      </igDock:SplitPane>
   </igDock:XamDockManager.Panes>
   <igDock:DocumentContentHost x:Name="DocumentHost" Background="DarkGray">
      <igDock:SplitPane x:Name="DocumentsSplit" SplitterOrientation="Vertical">
         <igDock:TabGroupPane x:Name="DocumentsPane" TabStripPlacement="Bottom">
            <igDock:ContentPane x:Name="Document" Header="Document" AllowDockingInTabGroup="False" AllowDockingBottom="False" AllowDockingLeft="False" AllowDockingRight="False" AllowDockingTop="False" AllowDocking="False" AllowPinning="False" AllowFloatingOnly="False">
               <Button Content="Document" IsEnabled="False" />
            </igDock:ContentPane>
         </igDock:TabGroupPane>
      </igDock:SplitPane>
   </igDock:DocumentContentHost>
</igDock:XamDockManager>