这是个简单的问题,也许很蠢,但我从几个小时开始就被困住了。
我在XAML部分有这样的观点:
<ContentPage.Resources>
<ResourceDictionary>
<System:Uint32 x:Key="UintValue">50</System:Uint32>
</ResourceDictionary>
</ContentPage.Resources>当然,为了获得<System>类型的访问权限,我使用了以下行:
xmlns:System="clr-namespace:System;assembly=mscorlib"但是,我有一个XAML解析异常。当我评论<System:Uint32...</System:Uint32>时,它就起作用了。#但是我们有价值..。
Type | Range | Size | .NET Framework type
uint | 0 to 4,294,967,295 | Unsigned 32-bit integer | System.UInt32所以如果我是对的,那么Uint32来自系统,所以我不得不像系统一样引用它:Uint32 32不是?
谢谢你帮忙!
发布于 2017-05-25 13:58:05
现在有点晚了,但我还是会发回信的。您需要导入的类型应该是UInt32,而不是区分大小写的Uint32。无论如何,如果要将此值绑定到边距或类似值,则应该使用String,因为它们可以接受更多由冒号分隔的整数,而且它们是字符串。
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:System="clr-namespace:System;assembly=mscorlib">
...
<System:UInt32 x:Key="sdsd">15</System:UInt32>
...
</ContentPage>https://stackoverflow.com/questions/40098193
复制相似问题