public void Flip() { Box a = isVertical ? vBox : hBox; Box b = isVertical ? hBox : vBox; a.Removed -= HandleRemoved; while (a.Children.Count() > 0) { var child = a.Children[0]; a.Remove(child); b.Add(child); if (child is DockItemTitleTab) (child as DockItemTitleTab).UpdateBehavior(); } box.Hide(); box = b; box.Removed += HandleRemoved; box.Show(); box.QueueDraw(); QueueResize(); var dc = Parent as DockContainer; if (dc != null) dc.RecalcLayout(); }