I would like to have an animation when an item in ListView changes position, so it would slowly move to the new position. Either in a template or in code. I've tried descending from a (Virtualizing)StackPanel and overriding ArrangeOverride to reposition and animate the items. the problem is that I don't know at what position the item was 'before' the update so I could transition to the new position nicely. I tried checking the TranslateTransform of the item, storing in a dictionary, overriding OnItemChanged and storing OldPosition/Position .. but none of there work because it seems the items are always recreated (from template).
Any other suggestions?
Use FluidMoveBehavior behaviour , it will make you life lot easier.
you can apply this to any itemscontrol in the following manner
<ItemsPanelTemplate x:Key="ItemsPanelTemplate">
<WrapPanel>
<i:Interaction.Behaviors>
<il:FluidMoveBehavior AppliesTo="Children" Duration="00:00:00.75"/>
</i:Interaction.Behaviors>
</WrapPanel>
</ItemsPanelTemplate>
you can find this behaviour in the Microsoft.Expression.Interactions.dll that is installed along with Blend 3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With