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

The Bouncing Ball Problem

Here’s some XAML designed for a large-screen phone that moves a ball up and down:

<Grid x:Name="ContentPanel" Grid.Row="1"> <Path Fill="Red"> <Path.Data> <EllipseGeometry RadiusX="25" RadiusY="25" /> </Path.Data> <Path.RenderTransform> <TranslateTransform x:Name="translate" X="240" /> </Path.RenderTransform> </Path> <Path Fill="{StaticResource PhoneAccentBrush}" Data="M 100 625 L 380 625, 380 640, 100 640 Z" /> <Grid.Triggers> <EventTrigger> <BeginStoryboard> <Storyboard RepeatBehavior="Forever"> <DoubleAnimation Storyboard.TargetName="translate" Storyboard.TargetProperty="Y" From="50" To="600" Duration="0:0:1" AutoReverse="True" RepeatBehavior="Forever" /> </Storyboard> </BeginStoryboard> </EventTrigger> </Grid.Triggers> ...

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