public override Size GetPreferredSize(Size proposedSize)
{
// Let base class continue with standard calculations
proposedSize = base.GetPreferredSize(proposedSize);
// Do we need to apply the border width?
if (AutoSize)
{
if (Orientation == Orientation.Horizontal)
proposedSize.Height = _stateCurrent.GetBorderWidth(_state);
else
proposedSize.Width = _stateCurrent.GetBorderWidth(_state);
}
return proposedSize;
}