Controlling Duration

Both DoubleAnimations used thus far have the default duration of one second, but you can change this by setting its Duration property inherited from Timeline:

<DoubleAnimation From="0" To="1" Duration="0:0:5" />

This changes the duration to five seconds. The syntax for specifying the length of time in XAML is the same as what TimeSpan.Parse accepts: days.hours:minutes:seconds.fraction.

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.