public void ClearChildren()
{
// Check the state of each child in turn
foreach (KeyValuePair<UIElement, MetaElementState> pair in _stateDict)
{
if (pair.Value.Status != MetaElementStatus.Removing)
{
// Mark element to be removed
pair.Value.Status = MetaElementStatus.Removing;
pair.Value.TargetChanged = true;
}
}
// Need to measure to force remove animation
InvalidateMeasure();
}