Exemple #1
0
        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;
            }
        }
Exemple #2
0
 protected override void Construct()
 {
     base.Construct();
     ToggleDiv = null;
     PageDiv   = null;
 }