public override Size GetPreferredSize(ViewLayoutContext context)
{
bool drawNonTrackingAreas = (_ribbon.RibbonShape != PaletteRibbonShape.Office2010);
// Update the views with the type of button being used
_viewLarge.ButtonType = _ribbonButton.ButtonType;
_viewLarge.DrawNonTrackingAreas = drawNonTrackingAreas;
_viewMediumSmall.ButtonType = _ribbonButton.ButtonType;
_viewMediumSmall.DrawNonTrackingAreas = drawNonTrackingAreas;
// Get the preferred size of button view
Size preferredSize = base.GetPreferredSize(context);
if (_currentSize == GroupItemSize.Large)
preferredSize.Height = _ribbon.CalculatedValues.GroupTripleHeight;
else
preferredSize.Height = _ribbon.CalculatedValues.GroupLineHeight;
return preferredSize;
}