public override void Layout(ViewLayoutContext context)
{
Debug.Assert(context != null);
// We take on all the available display area
ClientRectangle = context.DisplayRectangle;
// Do we need to add on our own border size
if (!_borderOutside)
{
// Reduce the display rectangle by the border
context.DisplayRectangle = CommonHelper.ApplyPadding(Orientation.Horizontal, context.DisplayRectangle, BorderPadding);
}
// Let children be layed out inside our space
base.Layout(context);
// Put back the original display value now we have finished
context.DisplayRectangle = ClientRectangle;
}