WPF Animation in ListBox

Do you know any example of how to animate an element insert on ListBox? The effect I was thinking about looks something like this:

  • First we have elements Aand Bon ListBox.

  • Than the element is added Cbetween A and B.

  • In the effect that I imagined, before insertion C Aand B gradually become more distant while the Element Cis between them. When we reach this point, Cinserted into the final.

My problem is that although I have already done something about templates (so that I can animate), I don’t know how to slowly separate the two elements on ListBox.

Any ideas?

Thank you in advance

+3
source share
1 answer

First insert the C element, but with a height of 0 and with hidden content (or transparent). Then animate the height of the C element to its full height: this will push apart A and B. Finally, make the contents of the C element visible (or change its opacity to viscosity).

+7
source

Source: https://habr.com/ru/post/1720848/


All Articles