public override Size GetPreferredSize(ViewLayoutContext context)
{
Debug.Assert(context != null);
bool visibleQATButtons = false;
// Scan to see if there are any visible quick access toolbar buttons
foreach(IQuickAccessToolbarButton qatButton in _ribbon.QATButtons)
if (qatButton.GetVisible())
{
visibleQATButtons = true;
break;
}
// Only show the border if there are some visible contents
_border.Visible = visibleQATButtons;
// If there are no visible buttons, then extra button must be for customization
if (!visibleQATButtons)
_extraButton.Overflow = false;
return base.GetPreferredSize(context);
}