public override void RemoveRange(int index, int count)
{
if (_isItemsHost)
base.RemoveRange(index, count);
else
{
VerifyWriteAccess();
// Make a copy of all elements to be removed
UIElement[] elements = new UIElement[count];
for (int i = 0; i < count; i++)
elements[i] = this[index + i];
// Remove them from the external collection
_externalChildren.RemoveRange(index, count);
// Instruct the visual parent it must measure with the change in state
_visualParent.InvalidateMeasure();
// Actual elements are removed from internal collection once removed animation completes
OnUIElementsRemove(new UIElementsEventArgs(elements));
}
}