Hey how can you turn json obects into a dictionary or something like that?
This is my json body:
{
"name": "person1",
"listOne": [{
"name": "list1",
"description": "",
"listTwo": [{
"name": "object1"
}, {
"name": "object2"
}, {
"name": "object3"
}]
}, {
"name": "list2",
"description": "",
"listTwo": [{
"name": "object1"
}, {
"name": "object2"
}]
}]
}
This are the classes:
public class JsonObject()
{
public string Name { get; set;}
public string Description { get; set;}
public List<string> MyList { get; set; }
}
public class MyList()
{
public string Name { get; set; }
}
The problem is that I cannot select the Name property from MyList! On my xaml page I see App1.Model.MyList.
How can I show the value from the property Name from the class MyList?
In my ViewModel this is my List that I return to the xamlpage:
private ObservableCollection<JsonObject> _ObjectList = new ObservableCollection<JsonObject>();
public ObservableCollection<JsonObject> ObjectList
{
get
{
return _ObjectList;
}
set
{
_ObjectList = value;
RaisePropertyChanged("ObjectList");
}
}
So I thought maybe create a disctionary and add thise values to it, but I can't reach the property Name from MyList class....