How to get Int32.MaxValue into a ItemsControl element
I am trying to put Int32.MaxValue into a ItemsControl using only XAML syntax using this markup:
<Grid xmlns:sys="clr-namespace:System;assembly=mscorlib">
<ItemsControl HorizontalAlignment="Left">
<sys:Int32>0</sys:Int32>
<sys:Int32><x:Static Member="sys:Int32.MaxValue" /></sys:Int32>
</ItemsControl&g开发者_运维技巧t;
using Kaxaml, I get an error stating that System.Int32 doesn't have a content property. Is this possible? What am I doing wrong?
Try this:
<ItemsControl HorizontalAlignment="Left">
<sys:Int32>0</sys:Int32>
<x:Static Member="sys:Int32.MaxValue" />
</ItemsControl>
精彩评论