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

Applying Theme Transitions to Elements

So how do you apply a theme transition to an element? Every UIElement has a Transitions property that can be set to a collection of Transition objects (the base class for all theme transitions). Using one of the theme transitions called EntranceThemeTransition as an example, the following XAML applies one to a Button on a Page:

<Page ...>  <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">    <Button Content="A Button with a Theme Transition">      <Button.Transitions>         <TransitionCollection>           <EntranceThemeTransition/>         </TransitionCollection>       </Button.Transitions>     </Button>  </Grid></Page>

When this Page becomes visible ...

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