public override Size GetPreferredSize(ViewLayoutContext context)
{
Debug.Assert(context != null);
// Get the preferred size requested by the children
Size size = base.GetPreferredSize(context);
// Apply the rounding in the appropriate orientation
if ((Orientation == VisualOrientation.Top) || (Orientation == VisualOrientation.Bottom))
{
size.Width += Rounding * 2;
size.Height += BorderWidth;
}
else
{
size.Height += Rounding * 2;
size.Width += BorderWidth;
}
return size;
}