Open wihrl opened 2 years ago
May i ask what's your usecase? I designed some of the animation APIs and i might be able to see what we need to change there
I'm trying to create an animation for adding and removing items. Basically when something is added play an animation and when something is removed first play an animation and then remove.
The best way of doing this i've found so far is to not add and remove stuff but instread set the IsVisible property. I've created a transition for this property that effectively "delays" the setter while letting the animation play out first by adding a certain class to the control that is transitioning.
This works well, but I need to create the transition instances from code and pass a reference to the control so that the transition can actually change the class of the control.
If the DoTransition method had the reference passed into it, this wouldn't be necessary and I could simply add the transition in XAML.
When trying to create a custom transition by overriding
Transition<T>
, one has to override theDoTransition
method. This method does not get a reference to the control currently being handled, but I've noticed that the parent method Apply does actually have it. It would be very useful to pass thisAnimatable
reference to theDoTransition
method for changing the behaviour of a transition on a per-control basis.An alternative would be to instead inherit the
ITransition
interface. There I've ran into another problem: the classTransitionInstance
is internal, so I cannot create an instance of it in my project, rendering theITransition
interface quite useless. (At least without having to create my own timer)Please either pass the
Animatable
reference to theDoTransntion
method or make theTransitionInstance
class public.