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" ...

Get XAML Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.