locked
Storyboard - how to restore original color/state? RRS feed

  • Question

  • Hi,
    If I use Storyboards to animate a checkbox to change color when checked (let's say "OnChecked"), how do I animate back to the originally designed color with "OnUnchecked"?  I mean if I use these custom checkboxes all over the place, assigning different starting colors for each one, how do I create a universal shared animation (in the control class) that reverts its "checked" color to the original one, without hardcoding a specific value? Is there any way to reference a designer-time color in the storyboard? Or at least a color set in a resource?
    Thanks.

    Monday, September 15, 2008 4:08 PM

Answers

  • try creating an animation without specifying any from or to values. I am not sure if it works in your case though

    This is what I am using to revert back to the original opacity of an image:
    <DoubleAnimation Storyboard.TargetProperty="(Image.Opacity)" Duration="0:0:0.2"/> 

    • Proposed as answer by Marco Zhou Friday, September 19, 2008 8:25 AM
    • Unproposed as answer by Marco Zhou Friday, September 19, 2008 8:25 AM
    • Marked as answer by Marco Zhou Friday, September 19, 2008 8:25 AM
    Monday, September 15, 2008 5:00 PM