/// <summary> /// Creates a panel which groups its elements in a column. /// </summary> /// <param name="page">The page containing the panel.</param> /// <param name="localTopCenter">The center of the top item of the panel, in MenuPage coordinates.</param> /// <param name="vspace">The space between consecutive elements.</param> /// <param name="rootLevel">True if the panel's navigation should be controlled by the MenuPage. False if it will be nested within another panel.</param> /// <param name="children">The items of the panel.</param> public VerticalItemPanel(MenuPage page, Vector2 localTopCenter, float vspace, bool rootLevel, params IMenuElement[] children) { Parent = page; this.localTopCenter = localTopCenter; this.vspace = vspace; Items = children.ToList(); Reposition(); ResetNavigation(); if (rootLevel) { Parent.AddToNavigationControl(this); } }