public override void AddChild(IElement child, int index = -1, bool instantPositioning = true) { base.AddChild(child, index, instantPositioning); if (child is ToggleDiv toggles) { if (ToggleDiv) { throw new DivvyException("TabsDiv can only have one ToggleDiv"); } ToggleDiv = toggles; ToggleDiv.OnToggleChanged += OnToggleChange; } if (child is PageDiv pages) { if (PageDiv) { throw new DivvyException("TabsDiv can only have on PagesDiv"); } PageDiv = pages; PageDiv.OnPageChange += OnPageChange; } }
protected override void Construct() { base.Construct(); ToggleDiv = null; PageDiv = null; }