1 回答
TA贡献1772条经验 获得超8个赞
您应该声明用户列表,检查以下内容:
public class User
{
[JsonProperty("email", NullValueHandling = NullValueHandling.Ignore)]
public string email { get; set; }
[JsonProperty("nickname", NullValueHandling = NullValueHandling.Ignore)]
public string nickname { get; set; }
[JsonProperty("password", NullValueHandling = NullValueHandling.Ignore)]
public string password { get; set; }
[JsonProperty("image", NullValueHandling = NullValueHandling.Ignore)]
public sring image { get; set; }
}
public class YourUsersData
{
[JsonProperty("users", NullValueHandling = NullValueHandling.Ignore)]
public List<User> Users { get; set; }
}
然后在隐藏代码中:
var usersList = JsonConvert.DeserializeObject<YourUsersData>(content);
ListViewUsers.ItemsSource = YourUsersData.Users;
- 1 回答
- 0 关注
- 93 浏览
添加回答
举报