What is my actual problem?
I want to stop Storyboard animation but keep current value of animated properties and unfreeze those properties.
What I have tried?
I tried storyboard.Pause()
but this will keep the animated properties frozen. (changing values has no effect) I want to be able to release all properties from storyboard.
storyboard.Stop()
doesn't work because it either sets value of animated properties to end or start of the animation depending on the FillBehavior
. Although it will unfreeze the properties.
I tried clearing storyboard.Childern
but it throws exception unless storyboard is fully stopped.
I tried to make new storyboard with duration 0 with same animations, this will stop previous animations and storyboard it self will finish in no time, but here are the problems
I should know what animations were added in last storyboard (I already solved this by storing dependency objects with property path in a List)
I have to retrieve current value of animated properties from property path.
I am stuck at the last one because this does not exist in UWP
string propertyPath = "(UIElement.Projection).(PlaneProjection.RotationY)";
// all animated properties are double
double value = (double)dependencyObject.GetValue(???);
GetValue
requires DependencyProperty
but i have a string.
Note: I just want a solution to my actual problem (top of this post).
RotationY
so it will be changed by user with drag. @BarryWang-MSFT – M.kazem Akhgary