0

Есть JSON:

{
  "status": "success",
  "total": 0,
  "metadata": {
    "next_page": "https://api.picsart.com/photos/search.json?popular=1&tag=origfte&animated_support=1&photo_history_inclusion=photo&q=origfte&offset=60"
  },
  "response": [
    {
      "license": "fte",
      "id": 335733859043201,
      "url": "https://cdn131.picsart.com/335733859043201.jpg",
      "title": "#sunset #sunsetloverparadise #idilicscenery #sunsettime #beautifulsunset #seaview #horizon #skyandclouds #sunsetsky #singletree #palmtree #birdsinflight #silhouettes #nature #summertime #warmweather #sunsetcolors #summersunset #naturephotography                                                                                             #freetoedit",
      "tags": [
        "sunset",
        "sunsetloverparadise",
        "idilicscenery",
        "sunsettime",
        "beautifulsunset",
        "freetoedit"
      ],
      "mature": false,
      "width": 1000,
      "height": 1229,
      "created": "2020-08-21T19:24:19.719Z",
      "type": "photo",
      "public": true,
      "likes_count": 4064,
      "comments_count": 25,
      "streams_count": 1003,
      "reposts_count": 117,
      "forks_count": 1001,
      "show_edit_history": false,
      "user": {
        "id": 183644448001102,
        "username": "macmmaya",
        "name": "M",
        "photo": "https://cdn140.picsart.com/316055570221201.jpg",
        "is_verified": true
      },
      "history_uploaded": false,
      "sources_count": 0,
      "has_similars": true
    },
    {
      "license": "fte",
      "id": 334378552034201,
      "url": "https://cdn141.picsart.com/334378552034201.jpg",
      "title": " #freetoedit 💜💜💜 #myedit #papicks #heart #cloud #background #clonetool #moon",
      "tags": [
        "freetoedit",
        "myedit",
        "papicks",
        "heart",
        "cloud",
        "background",
        "clonetool",
        "moon"
      ],
      "mature": false,
      "width": 1189,
      "height": 1516,
      "created": "2020-08-06T02:55:52.331Z",
      "type": "photo",
      "public": true,
      "likes_count": 4074,
      "comments_count": 15,
      "streams_count": 1813,
      "reposts_count": 165,
      "forks_count": 9831,
      "show_edit_history": false,
      "user": {
        "id": 255256878013102,
        "username": "taylse",
        "name": "taylse",
        "photo": "https://cdn130.picsart.com/333269874039201.jpg",
        "is_verified": true
      }
    }
  ]
}

Как мне получить url и отобразить их в ListBox?

Мои попытки:

string FilePath = Path.Combine(Package.Current.InstalledLocation.Path, "JsonData.json");
using (StreamReader file = File.OpenText(FilePath))
{
    var json = file.ReadToEnd();
    Dictionary<string, object> result = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, object>>(json);
    string pictures = result["response"].ToString();
    List<Rootobject> objResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Rootobject>>(pictures);
    PicsList.ItemsSource = objResponse;
}
10

0

Ваш ответ

Нажимая «Отправить ответ», вы соглашаетесь с условиями пользования и подтверждаете, что прочитали политику конфиденциальности.

Посмотрите другие вопросы с метками или задайте свой вопрос.