Andre Pena
Andre Pena

Reputation: 59456

WPF animation on a ListBox

Do you know any example of how to animate the insertion of an item on a ListBox? The effect I was thinking of is something like:

My problem is that, even though I already did something about templates (that I could animate), I don't know how to slowly separate two items on the ListBox.

Any ideas?

Thanks in advance

Upvotes: 3

Views: 1062

Answers (1)

itowlson
itowlson

Reputation: 74842

Insert the C item first, but with height 0 and with its content hidden (or transparent). Then animate the height of the C item to its full height: this will push A and B apart. Finally, make the content of the C item visible (or animate its opacity into visbility).

Upvotes: 7

Related Questions