Ok, I\'m having some difficult with this.
My JSON is like
{ \"names\" : [ {\"name\":\"bla\"} , {\"name\":\"bla2\"} ] }
I was trying
Using Json.Net (which supports Windows Phone)
string json = @"{ ""names"" : [ {""name"":""bla""} , {""name"":""bla2""} ] }";
var dict = (JObject)JsonConvert.DeserializeObject(json);
foreach (var obj in dict["names"])
{
Console.WriteLine(obj["name"]);
}
Or if you want to use it in a type-safe way
var dict = JsonConvert.DeserializeObject(json);
foreach (var obj in dict.names)
{
Console.WriteLine(obj.name);
}
public class RootClass
{
public MyName[] names { get; set; }
}
public class MyName
{
public string name { get; set; }
}