1 year ago

#340034

test-img

Avalyah

Is there an event when transition finishes?

I have made a wpf control called multiflip panel. It is an items control that takes on any number of children and displays a selected one of them. When selected item is changed, I animate the content presenter's ScaleTransform.ScaleX until it is 0, swap its content to the new item and then animate the ScaleX property to 1. This creates a nice animation that looks like the control was flipped.

I would like to recreate that in Avalonia, which doesn't have DoubleAnimation, it does however have DoubleTransition. So it is possible to animate the ScaleX property, but there doesn't seem to be an event on transition complete (like wpf Completed).

How would I go about doing the following sequence in Avalonia?

  1. Change ScaleX property to 0.
  2. Wait for transition to complete.
  3. Swap content of the contentpresenter.
  4. Change ScaleX property to 1.

c#

avaloniaui

avalonia

0 Answers

Your Answer

Accepted video resources