How to serialize a derived class in Silverlight
问题 I created a custom control in XAML, and added some custom properties as well. Now, I want to serialize it to JSON if possible. Here is (essentially) what I have: public partial class MyCustomClass : UserControl { public Dictionary<char, int[]> ValueMap; public int Value { get; set; } } And in the code that handles serialization: public static string Serialize(object objectToSerialize) { using (MemoryStream ms = new MemoryStream()) { DataContractJsonSerializer serializer = new