protected override Size MeasureOverride(Size availableSize)
{
// To ensure correct operation when transitioning between being an items host and
// not being an items host (and vica versa) we need to ask for the InternalChildren
// property. The base class implementation will automatically handle creating the
// item container generator and pulling it down again.
int c = InternalChildren.Count;
// Delegate calculation to the panel layout instance
if (_children != null)
{
// Use default layout so that any children not handled by the layout definitions is still processed
_defaultLayout.MeasureChildren(string.Empty, this, _stateDict, _children.CompoundElements, availableSize);
// Ask the layout strategy to measure the elements for us
return Layouts.MeasureChildren(LayoutId, this, _stateDict, _children.CompoundElements, availableSize);
}
else
return new Size();
}