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.
views:
321answers:
1
+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
2010-01-05 00:38:40