首页 > Web开发 > 详细

WP8.1开发中复杂JSON绑定数据时的方法

时间:2014-12-17 20:48:08      阅读:285      评论:0      收藏:0      [点我收藏+]

如果要绑定要一个集合中的另一个集合,比如这样的JSON:

 1   public class GetTransferInfo
 2     {
 3         public class Segment
 4         {
 5             public string Start_stat { get; set; }
 6             public string End_stat { get; set; }
 7             public string Line_name { get; set; }
 8             public string Stats { get; set; }
 9             public int Line_dist { get; set; }
10             public int Foot_dist { get; set; }
11         }
12         public class Segments
13         {
14             public List<Segment> Segment { get; set; }
15         }
16         public class Bus
17         {
18             public int Dist { get; set; }
19             public int Time { get; set; }
20             public int Foot_dist { get; set; }
21             public int Last_foot_dist { get; set; }
22             public Segments Segments { get; set; }
23         }
24         public class Buses
25         {
26             public List<Bus> Bus { get; set; }
27         }
28         public class Data
29         {
30             public int Result_num { get; set; }
31             public Buses Buses { get; set; }
32         }
33         
34             public int Status { get; set; }
35             public string Message { get; set; }
36             public Data data { get; set; }                 
37     }

 

这是前端XAML绑定时要这样写

Text="{Binding Segments.Segment[0].Start_stat}"

WP8.1开发中复杂JSON绑定数据时的方法

原文:http://www.cnblogs.com/AltriaPendragon/p/4170286.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!