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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -