开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜