tags:

views:

8

answers:

1

Hi,

I have a duration (0:0:0.5) that I use in a number of animations and I would like to define this number at one place only. I can define a double for instance as

<Window.Resources>
    <sys:Double x:Key="GridWidth">400</sys:Double>
</Window.Resources>

But not sure how a duration should be expressed as a resource. Thanks.

+1  A: 
<Window.Resources>
    <Duration x:Key="aDuration">0:0:0.5</Duration>
</Window.Resources>

In general, you can look at the MSDN doc for the type to see if they give XAML syntax. In the case of WPF types, there usually is: http://msdn.microsoft.com/en-us/library/ms602372.aspx.

codekaizen
That's easy! Thanks.