Example #1
0
        private void ExpandGroupBox(BaseController canvasController, FlowSharpLib.GroupBox gb, IEnumerable <GraphicElement> children)
        {
            canvasController.Redraw(gb, _ =>
            {
                gb.SetExpandedState();
                Rectangle r         = gb.DisplayRectangle;
                gb.DisplayRectangle = new Rectangle(r.Location, gb.ExpandedSize);
                // Update connections after display rectangle has been updated, as this adjusts the connection points.
                canvasController.UpdateConnections(gb);
            });

            // In an expand , not all the children may redraw because the collapsed groupbox does not intersect them!
            children.ForEach(el =>
            {
                el.Visible = true;
                el.Redraw();
            });
        }