c# - DoubleAnimation, how do I perform an action at a certain value? -
i have rectangle using planeprojection spin on y axis. range set 0 360 , works fine. change fill color once value reaches point, 180 , @ 360 in case. can't see find way "watch" property , animation exposes completed event.
the possible way can think of setup 2 animations, 1 0 180 , 180 360, , change color , forth in between. method feels little kludgy me though , i'm not sure how 2 animations fire continuously in loop.
thanks
you try bind (custom?) property rotation property on planeprojection , in property change handler change fill color.
another option use coloranimationusingkeyframes discretecolorkeyframe , set color of solidcolorbrush used fill @ time when value of rotation reaches desired value. note value 180 typically in half time set animation duration unless use doubleanimationusingkeyframes or use easing functions.
then bind fill property rotation property on planeprojection converter chooses correct color.
Comments
Post a Comment