O'Reilly logo

XAML Unleashed by Adam Nathan

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

Flexibility with From and To

The following Page adds a ScaleTransform to the Button and applies two Storyboards to animate it: one triggered by PointerEntered, and one triggered by PointerExited and similar events:

<Page ...>  <Page.Resources>    <!-- Two Storyboards, one for growing and one for shrinking -->    <Storyboard x:Name="growStoryboard" TargetName="t" TargetProperty="ScaleX">      <DoubleAnimation From="1" To="1.4"/>    </Storyboard>    <Storyboard x:Name="shrinkStoryboard" TargetName="t" TargetProperty="ScaleX">      <DoubleAnimation From="1.4" To="1"/>    </Storyboard>  </Page.Resources>  <Canvas Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">    <Button Content="Animating Button" ...

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