Storyboards with Multiple Animations

As mentioned when Storyboards were introduced, they can contain one or more animations. Here’s an update to the Button-scaling XAML that scales it in both directions simultaneously (and omits the From values to avoid the “jump” effect):

<Page ...>  <Page.Resources>    <!-- Two Storyboards, one for growing and one for shrinking -->    <Storyboard x:Name="growStoryboard" TargetName="t">      <DoubleAnimation To="1.4" Storyboard.TargetProperty="ScaleX" />      <DoubleAnimation To="1.4" Storyboard.TargetProperty="ScaleY" />    </Storyboard>    <Storyboard x:Name="shrinkStoryboard" TargetName="t">      <DoubleAnimation To="1" Storyboard.TargetProperty="ScaleX" />      <DoubleAnimation ...

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.