/// <summary> /// Move pane to a container relative to targetPaneGroup. /// </summary> /// <param name="pane">Pane to be moved</param> /// <param name="targetPaneGroup"> </param> /// <param name="depth">Refer a parent container of targetPaneGroup, each depth is one parent container away. /// Depth 0 add a PaneContainer in the same container if the container is horizontal, if not /// adds the movedPane to a new child vertical container</param> /// <param name="moveRigth"> True to move pane to the rigth of targetPaneGroup </param> internal static void MovePaneHorizontally(TabButton pane, PaneGroup targetPaneGroup, uint depth, bool moveRigth) { var container = GetParentContainer(targetPaneGroup); if (!container.IsHorizontal) { var childContainer = new Container(container) { IsHorizontal = true }; container.ReplacePanel(targetPaneGroup, childContainer, false); childContainer.InsertPanel(targetPaneGroup); container = childContainer; } var paneGroup = new PaneGroup(container); paneGroup.AddPage(pane); container.InsertPanel(paneGroup, targetPaneGroup, !moveRigth); }
/// <summary> /// Move pane from the current PaneGroup to the targetPaneGroup. /// </summary> /// <param name="pane">Pane to be moved</param> /// <param name="targetPaneGroup"></param> internal static void MovePane(TabButton pane, PaneGroup targetPaneGroup) { targetPaneGroup.AddPage(pane); }