public override void Remove(UIElement element)
{
if (_isItemsHost)
base.Remove(element);
else
{
VerifyWriteAccess();
// Remove only from the external collection
_externalChildren.Remove(element);
// 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(element));
}
}