views:

321

answers:

1

What is the xaml equivalent of MyProperty = double.MaxValue? I'm afraid I'll need to use something like MyProperty="{x:Static sys:Int32.MaxValue}", but not sure, and can't find the equivalent for double. Thanks.

+3  A: 

Found:

add this in the namespaces section of the control to access System library:

... xmlns:sys="clr-namespace:System;assembly=mscorlib" ...

then, to set Maximum property of MyControl control in ctr namespace:

<ctr:MyControl Maximum="{x:Static sys:Double.MaxValue}"/>

Edit:

{x:Static sys:Double.PositiveInfinity}

works too, but I suspect it is not appropriate to use it in this context, it seems to be reserved for evaluation like if (x==Double.PositiveInfinity). Experts can elaborate...

Mike