what is the best way to remove all the views from a region at once?
there is no region.views.removeall method. If I try to use the code below
private void clearRegionViews(IRegion region)
foreach (object view in region.Views)
if (view != null)
An exception will be generated "Collection was modified; enumeration operation may not execute.".
I am trying to clear the region everytime a new tab is selected in an tabcontrol.