介紹
與眾不同 windows phone 8.0 之 新的控制項
新的控制項 - LongListSelector
示 例
示範 LongListSelector 控制項的應用
1、提供資料
Controls/CityInfo.txt
101330101=澳門=aomen101080904=阿巴嘎=abagaqi101271901=阿壩=aba101050104=阿城=acheng101081102=阿爾山=aershan101131504=阿合奇=aheqi101130801=阿克蘇=akesu101131503=阿克陶=aketao101130701=阿拉爾=alaer101131606=阿拉山口=alashankou101081202=阿右旗=alashanyouqi101081201=阿左旗=alashanzuoqi101131401=阿勒泰=aletai101140701=阿里=ali101080603=阿魯旗=aluqi101081003=阿榮旗=arongqi101131501=阿圖什=atushi101130809=阿瓦提=awati101050503=安達=anda101160208=安定=anding101140605=安多=anduo101240612=安福=anfu101090220=安國=anguo101250704=安化=anhua101210203=安吉=anji101110701=安康=ankang
Controls/CityInfo.cs
namespace Demo.Controls{ /// <summary> /// city 資訊實體類 /// </summary> public class CityInfo { /// <summary> /// city 標識 /// </summary> public string CityId { get; set; } /// <summary> /// city 名稱 /// </summary> public string Name { get; set; } /// <summary> /// city 拼音 /// </summary> public string Pinyin { get; set; } /// <summary> /// 擷取城市的拼音首字母 /// </summary> public static string GetFirstPinyinKey(CityInfo cityInfo) { char indexLetter = char.ToUpper(cityInfo.Pinyin[0]); if (indexLetter < 'A' || indexLetter > 'Z') { indexLetter = '#'; } return indexLetter.ToString(); } }}