c# - Animating the background image of a button? -
i impressed of how wikipedia app looks in wp7 , facinated on how moving background of buttons work.
i wanted similar thing, ideas on how can it?
here's pretty simple way it:
<image source="/assets/applicationicon.png" verticalalignment="top" margin="0"> <image.resources> <storyboard x:name="shift"> <doubleanimation from="0" to="100" duration="0:0:2" storyboard.targetname="translation" storyboard.targetproperty="translatey" autoreverse="true" repeatbehavior="forever"/> <doubleanimation from="0" to="100" duration="0:0:5" storyboard.targetname="translation" storyboard.targetproperty="translatex" autoreverse="true" repeatbehavior="forever"/> </storyboard> </image.resources> <image.rendertransform> <compositetransform x:name="translation"/> </image.rendertransform> </image>
with mainpage.xaml.cs:
public mainpage() { initializecomponent(); shift.begin(); }
Comments
Post a Comment