Poke UIElement Z-Index when a container is being recycled in ReorderGridAnimation #1459
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Due to the way XAML handles item container recycling in virtualized lists, simply setting the ImplicitAnimations property on the backing visual to null in the recycled case produces undesirable behavior when adding and removing items. Without getting too into XAML implementation details, containers that will be recycled are stored off screen and when they are reused for a new item the item will fly into their new position from the upper left. The solution is to force XAML to disable the implicit animations for that commit by poking the UIElement's Z-Index. We planned to fix the sample in the WindowUIDevLabs that also has this issue but that hasn't made it to the repo yet.