0

It's a simple question, maybe stupid, but I'm stuck from hours..

I have that in the XAML part:

<ContentPage.Resources>
  <ResourceDictionary>
    <System:Uint32 x:Key="UintValue">50</System:Uint32>
  </ResourceDictionary>
</ContentPage.Resources>

Of course, to have the <System> type access, I had this line:

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

However, I have an XAML parse Exception.. When I comment <System:Uint32...</System:Uint32> then it works. #ButIDontHaveTheValue..

There is a link to the doc of Uint

Type | Range              | Size                    | .NET Framework type
uint | 0 to 4,294,967,295 | Unsigned 32-bit integer | System.UInt32

So If I'm right, then Uint32 is coming from System, so I have to reference it like System:Uint32 isn't?

Thank for help !

Emixam23
  • 3,854
  • 8
  • 50
  • 107

1 Answers1

1

Its a bit late but I will post an answer anyway. The type you need to import should be UInt32 instead of Uint32, case sensitive. Anyway if you want to bind this value to a Margin or similar value you should use String instead because they could take more integers separated by a colon and they are a 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>