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

XAML-Based Animations

Defining storyboards and animations in XAML is ostensibly easier than defining them in code, and for that reason you’ll find the vast majority of Silverlight storyboards and animations in XAML. But there are some issues involving the sharing of resources.

Let’s try to rewrite the ClickAndSpin program to use XAML for the storyboards and animations. The XamlClickAndSpin program has the following content area:

Example 15-5. Silverlight Project: XamlClickAndSpin File: MainPage.xaml (excerpt)

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="*" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Button Name="btn1" Content="Button No. 1" Grid.Row="0" ...

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