このコードを使用して、xml の結果を listpicker コントロールに解析します。
if (e.Error != null)
return;
XElement xmlItems = XElement.Parse(e.Result);
var list = new List<auth>();
foreach (var response in xmlItems.Descendants("result"))
{
var nom = (string)response.Element("nom").Value;
var id = (string)response.Element("id").Value;
list.Add(new auth
{
state = nom,
id = id,
});
}
this.defaultPicker.ItemsSource = list;
this.defaultPicker.DisplayMemberPath = "state";
<response><status>OK</status><result><id>1</id><nom>ARIANA</nom></result><result><id>2</id><nom>BEJA</nom></result>.....</response>
最初の項目のみを返しますが、リストをクリックすると、認証クラスのパスのリストに移動します! アイデアはありますか?