I am working with Visual States in a ToggleButton template within a Windows 10 UWP app.
I have added an animation for the 'Checked' state so when checked, an icon within the template rotates 90 degrees over 250 milliseconds.
Now I want to animate the icon rotating back to normal over the same 250 millisecond timespan when the ToggleButton is no longer checked.
Problem is, there is no 'Unchecked' state to animate anymore for ToggleButton - so it seems like this is impossible.
Surely I have this wrong somehow - so has anyone managed to animate a ToggleButton moving to the 'Unchecked' state (which apparently no longer exists??????)
Thanks
Dean
It is better to try using CheckBox as it contains 'Unchecked' states.
As I've tried Normal state seems to mean Unchecked - note also that all states have equivalents ('Normal -> Pressed' and 'Checked -> CheckedPressed'). Basing upon this, I'm able to make a ToggleButton which rotates its Content like this:
Sample usage:
As you can see I've also subscribed to VisualStateGroup's CurrentStateChanged event, so it's easier to see how the states are changing.
you can try out this: