O'Reilly logo

Microsoft® Silverlight® Edition: Programming Windows® Phone 7 by Charles Petzold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Key Frame Animations

If you like the idea of giving the user some visual feedback from a button, but the 360° spin is just a bit too ostentatious, perhaps jiggling the button a little might be more polite. So you open a new project named JiggleButtonTryout and begin experimenting.

Let’s start with just one Button with a TranslateTransform set to the RenderTransform property:

Example 15-13. Silverlight Project: JiggleButtonTryout File: MainPage.xaml (excerpt)

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
    <Button Content="Jiggle Button"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            Click="OnButtonClick">
        <Button.RenderTransform>
            <TranslateTransform x:Name="translate" />
        </Button.RenderTransform>
    </Button>
</Grid>

In the Resources ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required