This project is read-only.

Retrieve list of existing DockablePanes

Nov 18, 2008 at 7:45 AM

Is it possible to retrieve a list of DockablePanes?

Currently I am having problems with dynamically adding DockableContent objects to existing DockablePanes. For example, I define some dockable panes in xaml:

<ad:DockingManager x:Name="dockingManager">
 <!-- Main resizing panel -->
 <ad:ResizingPanel x:Name="mainResizingPanel" Orientation="Vertical">               
  <!-- Horizontal resize panel -->
  <ad:ResizingPanel Orientation="Horizontal">
   <!-- Left resizing panel -->
   <ad:ResizingPanel x:Name="leftResizingPanel" Orientation="Vertical">
    <!-- Left top dock -->
    <ad:DockablePane x:Name="leftTopDockablePane" ad:ResizingPanel.ResizeWidth="300">
    <!-- Left bottom dock -->
    <ad:DockablePane x:Name="leftBottomDockablePane" ad:ResizingPanel.ResizeWidth="300">

   <!-- Document host -->
   <ad:DocumentPane x:Name="documentHost">
    <!-- Web document content -->
    <dockablecontent:WebDocumentContent x:Name="webDocumentContent" />
    <!-- Placeholder for documents -->

   <!-- Right resizing panel -->
   <ad:ResizingPanel x:Name="rightResizingPanel" Orientation="Vertical">
    <!-- Right top dock -->
    <ad:DockablePane x:Name="rightTopDockablePane" ad:ResizingPanel.ResizeWidth="400">
    <!-- Right bottom dock -->
    <ad:DockablePane x:Name="rightBottomDockablePane" ad:ResizingPanel.ResizeWidth="400">
  <!-- Bottom resizing panel -->
  <ad:ResizingPanel x:Name="bottomResizingPanel" Orientation="Vertical">
   <!-- Bottom dock -->
   <ad:DockablePane x:Name="bottomDockablePane" ad:ResizingPanel.ResizeWidth="100" ad:ResizingPanel.ResizeHeight="200">
    <!-- Log DockableContent -->
    <dockablecontent:OutputDockableContent x:Name="outputDockableContent" />

I can retrieve the bottomDockablePane by using outputDockableContent.Parent. Then, I can successfully add a new dockable content. However, when I directly add an item to the bottomDockablePane, nothing happens. I can't find any properties to retrieve existing DockablePanes from the docking manager either.

Any ideas how to handle this problem?

Nov 18, 2008 at 10:30 AM
For the moment, I fixed this by adding dummy contents to each pane. Then, I hide the dummy contents after initializing the dynamic dockable contents. One problem is that when content is removed from the DockablePane, when the count reaches 0, the DockablePane is removed from the parent (mostly ResizablePanel). Why is this?

I have commented the code in DockablePane.RemoveContent to remove itself from the ResizablePanel. However, restoring is not going very well (yet). What is the main reason to remove dockable panes without any dockable content (now I can't define some general docking placeholders that I can easily use to dock new dockablecontents).