Ok, we\'re using Newtonsoft\'s JSON.NET product, which I really love. However, I have a simple class structure for hierarchical locations that look roughly like this...
Usually when I find myself fighting something like this it tells me I should consider another approach. In this case, I would recommend the following view model structure as an alternative:
public class Location
{
public bool IsExpanded { get; set; }
public string Name { get; set; }
public List Locations { get; set; }
}
public class ViewModel
{
public List RootLocations { get; set; }
}