开发者

Silverlight XAML: "The type 'Byte' was not found."

开发者 https://www.devze.com 2023-02-16 00:25 出处:网络
I\'m having trouble serializing a XAML resource dictionary file for my Silverlight application that uses a Byte as an entry. I\'ve more or less copied the examples of how this has worked for others, b

I'm having trouble serializing a XAML resource dictionary file for my Silverlight application that uses a Byte as an entry. I've more or less copied the examples of how this has worked for others, but still seem to be missing something.

The XAML:

<ResourceDictionary
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
   xmlns开发者_JAVA百科:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:system="clr-namespace:System;assembly=mscorlib">

   <system:Byte x:Key="PrimaryLightColorAlphaValue">#FF</system:Byte>
...

The system namespace is included as per other examples, and Intellisense appears to validate the XAML pre-compilation/runtime, yet I still get an error at runtime when the file attempts to load:

The type 'Byte' was not found. [Line: 6 Position: 24]

Any ideas? Hopefully I'm missing something simple.


The only native types supported in Silverlight's flavor of XAML are double, int, bool, string and Uri. I know no smart way around this bogus limitation, sorry.

Reference: XAML Usage Syntax

0

精彩评论

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

关注公众号