private void OnUIElementsRemove(object sender, UIElementsEventArgs e)
{
foreach (UIElement element in e.Elements)
{
MetaElementState elementState = _stateDict[element];
elementState.Status = MetaElementStatus.Removing;
elementState.TargetChanged = true;
}
// If we are animating the removal of an element then it might not cause a
// measure to occur because we do not actually remove it from the visual
// collection. So force measure here so animation will be started.
InvalidateMeasure();
}