Here is my data type:
using System;
namespace UI
{
public class AddressType
{
public byte ID { get; set; }
public string Name { get; set; }
}
}
Here is my collection:
using System.Collections.ObjectModel;
namespace UI
{
public class AddressTypes : ObservableCollection<AddressType>
{
}
}
Here is my XAML from my UserControl.Resources section of my page:
<local:AddressTypes x:Name="AddressTypesList">
<local:AddressType ID="0" Name="Select"/>
<local:AddressType ID="1" Name="Office"/>
<local:AddressType ID="2" Name="Shipping"/>
<local:AddressType ID="3" Name="Warehouse"/>
<local:AddressType ID="4" Name="Home"/>
<local:AddressType ID="5" Name="Foreign"/>
</local:AddressTypes>
When I try to assign a value in XAML to the ID property, I get a AG_E_PARSER_BAD_PROPERTY_VALUE [Line: 10 Position: 35] error. If I change the data type of the ID property to int, all is well. Doesn't Silverlight support the byte data type?