public void CheckPerformLayout(bool viewLayout)
{
// Cannot process a disposed control, is the layout dirty?
if (!IsDisposed && !Disposing && _layoutDirty)
{
PerformLayout();
// Do we have a manager to use for laying out?
if (viewLayout && ((ViewManager != null) && (_renderer != null)))
{
// Prevent infinite loop by looping a maximum number of times
int max = 5;
do
{
// Layout cannot now be dirty
_layoutDirty = false;
// Ask the view to peform a layout
ViewManager.Layout(_renderer);
} while (_layoutDirty && (max-- > 0));
}
}
}