Populate ListPicker With XML In Windows Phone
Posted by blogmeister on
March 2, 2012
It is easy to populate the XML contents into a ListPicker control in Windows Phone.
Let us say this is how your XML looks like
|
1 2 3 4 |
<countries name="countries"> <country>Afghanistan</country> <country>Albania</country> </countries> |
See code below.
|
1 2 |
XDocument doc = XDocument.Load("country.xml"); MyListPicker.ItemsSource = from query in doc.Descendants("country") select query.Value; |








