This is under Silverlight 3, so a number of .NET options are unavailable, like ICloneable/Clone method. I've been stuck for days at trying to clone a List of objects. I already spent hours Googling and asking on the ASP.NET forums and SL forums.
Here is a pseudocode of what I'm trying to do:
Apparently newList is just a reference to the original list. The first item's name property will also be changed to "Bob". I need a deep clone of the list. A copy, not a reference. But Silverlight is lacking a number of methods, such as list<T>.Clone, ICloneable, etc for me to do that. What other solutions are there?
Here is a pseudocode of what I'm trying to do:
Code:
List<objectType> originalList = ................
List<objectType> newList = new List<objectType>(originalList);
newList[0].name = "Bob";
Apparently newList is just a reference to the original list. The first item's name property will also be changed to "Bob". I need a deep clone of the list. A copy, not a reference. But Silverlight is lacking a number of methods, such as list<T>.Clone, ICloneable, etc for me to do that. What other solutions are there?
