开发者

How to get Int32.MaxValue into a ItemsControl element

开发者 https://www.devze.com 2023-03-19 19:56 出处:网络
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\">

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> 
0

精彩评论

暂无评论...
验证码 换一张
取 消