ComponentFactory.Krypton.Toolkit.ViewLayoutFill.GetPreferredSize C# (CSharp) Method

GetPreferredSize() public method

Discover the preferred size of the element.
public GetPreferredSize ( ViewLayoutContext context ) : Size
context ViewLayoutContext Layout context.
return System.Drawing.Size
        public override Size GetPreferredSize(ViewLayoutContext context)
        {
            // Get requested size of the control
            Size size = (_control != null ? _control.GetPreferredSize(context.DisplayRectangle.Size) : Size.Empty);

            // Return size with padding added on
            return new Size(size.Width + DisplayPadding.Horizontal,
                            size.Height + DisplayPadding.Vertical);
        }