Tuesday, 30 April 2013

Simple UI scaling animation

       I often forget about different properties used with animation, hence another post about it, to follow up the previous one. It's just a small code snippet that fits just right into the previous code. Scaling animation isn't as useful as the sliding out one in my opinion, but it might come in handy one day, and I don't wanna have to roam the internet for hours to find it again.
       The only part that changes from the code in the last post are the storyboards. You can replace them with the ones below and it should work from the get go.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
<Storyboard x:Key="firstStoryboard">     
    <DoubleAnimation Storyboard.TargetName="animatedGrid2"
    Duration="00:00:00.3"
    Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
    To="1" />
</Storyboard>
<Storyboard x:Key="secondStoryboard">
    <DoubleAnimation Storyboard.TargetName="animatedGrid2"
    Duration="00:00:00.3"
    Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
    To="0" />
</Storyboard>
     
         Because the site I usually use for code to html conversion http://puzzleware.net/codehtmler/ seems to be down, and I don't have Visual Studio with the code conversion plugin nearby I've used another web code converter, that's why a different theme. The one I used today is: http://hilite.me/

No comments:

Post a Comment