public override void Layout(ViewLayoutContext context)
{
Debug.Assert(context != null);
// Update our enabled and checked state
UpdateEnabledState();
UpdateCheckedState();
UpdateDropDownState();
// We take on all the available display area
ClientRectangle = context.DisplayRectangle;
// Let child elements layout in given space
base.Layout(context);
// For split buttons we need to calculate the split button areas
if (_ribbonColorButton.ButtonType == GroupButtonType.Split)
{
// Find the position of the split area
int smallSplitRight = _viewMediumSmallText2Sep1.ClientLocation.X;
_viewMediumSmall.SplitRectangle = new Rectangle(smallSplitRight, ClientLocation.Y, ClientRectangle.Right - smallSplitRight, ClientHeight);
}
else
_viewMediumSmall.SplitRectangle = Rectangle.Empty;
}