public virtual Size GetPreferredSize(IRenderer renderer,
Size proposedSize)
{
if ((renderer == null) || (Root == null))
return Size.Empty;
Size retSize = Size.Empty;
// Short circuit for a disposed control
if (!_control.IsDisposed)
{
// Create a layout context for calculating size and positioning
using (ViewLayoutContext context = new ViewLayoutContext(this,
_control,
_alignControl,
renderer,
proposedSize))
{
retSize = Root.GetPreferredSize(context);
}
}
if (_outputDebug)
{
Console.WriteLine("Id:{0} GetPreferredSize Type:{1} Ret:{2} Proposed:{3}",
Id,
_control.GetType().ToString(),
retSize,
proposedSize);
}
return retSize;
}