animation - Did WPF storyboard end naturally, or was it interrupted? -
background: creating application using eye tracking. prevent buttons being activated inadvertently short glance, wish introduce delay between user's gaze landing on button , button being activated.
i have created animation colours button left right give user visual feedback, shown below on number '6' (ignore red dots, tracking markers won't show normally). if user looks away before timeout, button not activated; if gaze still on button @ end of timeout, button activated.
don't have reputation post images; it's @ http://i.stack.imgur.com/fu3j7.jpg.
as using animation provide visual feedback user, seems sensible me trigger button activation animation completion.
the animation triggered follows:
<style.triggers> <trigger property="**attached property providing gaze notification**" value="true"> <trigger.enteractions> <beginstoryboard storyboard="{staticresource animatebutton}" /> </trigger.enteractions> <trigger.exitactions> <beginstoryboard> **storyboard return button normal** </beginstoryboard> </trigger.exitactions> </trigger> </style.triggers>
the storyboard defined in window's resources, completed event handler assigned. in handler, i'm printing debug.writeline(((animationclock)sender).currenttime);
. irrespective of whether user looks away button immediately, or holds gaze long enough (currently 0.5s) activate button, value printed 00:00:00.5000000
. looking through other fields of clock instance doesn't give hints either.
so, after exposition, question: is there method of determining whether animation ran completion of own accord, or whether interrupted storyboard kicked off trigger.exitactions
?
my alternative hook attached property providing gaze notification changes, start timer same length of time animation, check whether button still has gaze after time, prefer animation-driven method if it's viable.
thank you.
Comments
Post a Comment