public override void Layout(ViewLayoutContext context)
{
Debug.Assert(context != null);
// We take on all the available display area
ClientRectangle = context.DisplayRectangle;
// Find the correct padding to use
Padding padding = (_ribbon.RealMinimizedMode ? _layoutMinimizedPadding : _layoutNormalPadding);
// Reduce display rect by our border size
context.DisplayRectangle = new Rectangle(ClientLocation.X + padding.Left,
ClientLocation.Y + padding.Top,
ClientWidth - padding.Horizontal,
ClientHeight - padding.Vertical);
// Let contained content element be layed out
base.Layout(context);
// Put back the original display value now we have finished
context.DisplayRectangle = ClientRectangle;
}