Animating the repositioning of items' collection
Once you remove an item from the collection, it just disappears. However, it is possible to reposition the remaining elements with the animation, as shown in this recipe.
Getting ready
To step through this recipe, you need the project from the previous recipe.
How to do it...
To modify the preceding example to use animation while repositioning elements within ItemsControl
when any are removed, perform the following steps:
Add a name to
ItemsControl
and applyRepositionThemeTransition
to enable the effect of repositioning items after you remove any of them. Do this by modifying the content of theMainPage.xaml
file, as follows:<Page (...)> <Grid (...)> <ItemsControl x:Name="Months"> <ItemsControl.ItemContainerTransitions> <TransitionCollection> <EntranceThemeTransition ...