Exemple #1
0
        private void RemoveTopSide()
        {
            if (TopSide != null)
            {
                TopSide.Parent = null;
                TopSide.Dispose();
                TopSide = null;

                var bounds = RootControl.Bounds;
                bounds.Y          -= Renderer.SideTabHeight;
                bounds.Height     += Renderer.SideTabHeight;
                RootControl.Bounds = bounds;
                var vcs = Height - Renderer.SideTabHeight * 2;
                if (BottomSide != null)
                {
                    vcs -= Renderer.SideTabHeight;
                }
                if (LeftSide != null)
                {
                    var h   = LeftSide.Height;
                    var len = LeftSide.OptimalLength;
                    if (h >= len)
                    {
                        LeftSide.Top = ViewConstants.Spacing;
                    }
                    else
                    {
                        if (len > vcs)
                        {
                            len = vcs;
                        }
                        LeftSide.SetBounds(
                            0, ViewConstants.Spacing, Renderer.SideTabHeight, len,
                            BoundsSpecified.Y | BoundsSpecified.Height);
                    }
                }
                if (RightSide != null)
                {
                    var h   = RightSide.Height;
                    var len = RightSide.OptimalLength;
                    if (h >= len)
                    {
                        RightSide.Top = ViewConstants.Spacing;
                    }
                    else
                    {
                        if (len > vcs)
                        {
                            len = vcs;
                        }
                        RightSide.SetBounds(
                            0, ViewConstants.Spacing, Renderer.SideTabHeight, len,
                            BoundsSpecified.Y | BoundsSpecified.Height);
                    }
                }
            }
        }