I'm able to declare an integer or double value in xaml. However, I can't add a decimal value. It builds ok, but then I get:
System.Windows.Markup.XamlParseException: The type 'Decimal' was not found.
Here's the xaml code:
<UserControl.Resources>
<system:Int32 x:Key="AnIntValue">1000</system:Int32><!--Works!-->
<system:Double x:Key="ADoubleValue">1000.0</system:Double><!--Works!-->
<system:Decimal x:Key="ADecimalValue">1000.0</system:Decimal><!--Fails at runtime-->
</UserControl.Resources>
Here's how I'm declaring the system namespace:
xmlns:system="clr-namespace:System;assembly=mscorlib"
Edit: Workaround: As Steven mentioned, adding the resource through code-behind seems to work fine:
Resources.Add("ADecimalValue", new Decimal(1000.0));
Edit: Answer: Doing exactly the same thing in WPF seems to work fine. So I guess this is a hidden silverlight restriction. Thanks to Steven for this finding.