I am looking to dock dock panels to an existing dock panel.
My current layout is as follows. On the left of the window is a settings dock panel. On the right is another dock panel. The right dock panel takes up most the of window. The left dock panels contain items that, when interacted with(controls, etc), effect what is seen in the right dock panel.
I need to add new left side dock panels dynamically. The first one should dock to the bottom of the settings dock panel. The second one should dock to the first, and so on.
I can get the first new dock panel to dock to the settings dock panel as I want. Any subsequent dock panels though do not dock to the bottom of the previous. Instead, they dock to the right of the previous and force #1 into a column. Here is my code:
// Add a new dock panel
DockPanel dockPanel = dockManager1.AddPanel(DockingStyle.Top);
// Dock the panel to the previous panel
if (mLeftSidePanels.Count == 0)
dockPanel.DockTo(dockPanelSettings);
else
dockPanel.DockTo(mLeftSidePanels[mLeftSidePanels.Count - 1].DockPanel);
// Add the left side dock panel to our collection
mLeftSidePanels.Add(dockpanel);
Please, try the following approach: