+ switch( conditionToSet )
+ {
+ case TransitionCondition.ChangeOnAdd :
+ {
+ // If other children also being added (TransitionCondition.Add) then do not change their
+ // conditions, Continue to use their Add transitions.
+ if (childLayout.ConditionForAnimation.HasFlag(TransitionCondition.Add))
+ {
+ break; // Child being Added so don't update it's condition
+ }
+ else
+ {
+ // Set siblings for the child being added to use the ChangeOnAdd transition.
+ childLayout.ConditionForAnimation = TransitionCondition.ChangeOnAdd;
+ }
+ break;
+ }
+ case TransitionCondition.ChangeOnRemove :
+ {
+ if (childLayout.ConditionForAnimation.HasFlag(TransitionCondition.Remove))
+ {
+ break; // Child being Removed so don't update it's condition
+ }
+ else
+ {
+ childLayout.ConditionForAnimation = TransitionCondition.ChangeOnRemove;
+ }
+ break;
+ }
+ case TransitionCondition.LayoutChanged :
+ {
+ childLayout.ConditionForAnimation = TransitionCondition.LayoutChanged;
+ break;
+ }
+ }