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

Using a Storyboard

One of the theme animations is called FadeOutThemeAnimation, and it knows how to make any element fade out. Let’s see how to apply that to a simple Button on a Page. This must be done with an object called a Storyboard. Storyboards can contain one or more animations and associate them with specific elements. Here’s a Page with the Button we want to animate and the Storyboard that provides context to the FadeOutThemeAnimation:

<Page ...>  <Page.Resources>    <Storyboard x:Name="storyboard" TargetName="b" >      <FadeOutThemeAnimation/>     </Storyboard>  </Page.Resources>  <Canvas Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">    <Button Name="b" >Animating Button</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