protected override Size MeasureOverride(Size sizeAvailable)
{
formtxt = new FormattedText(Text, CultureInfo.CurrentCulture, FlowDirection,
new Typeface(FontFamily, FontStyle, FontWeight, FontStretch), FontSize, Foreground);
Size sizeDesired = new Size(Math.Max(48, formtxt.Width)+4, formtxt.Height+4);
sizeDesired.Width += Padding.Left + Padding.Right;
sizeDesired.Height += Padding.Top + Padding.Bottom;
return sizeDesired;
}