【发布时间】:2012-03-19 10:24:39
【问题描述】:
我有一个 WP7,它读取 XML 文件,获取一些元素并将它们绑定到 listbox
代码如下:
XDocument data = XDocument.Load("file.xml");
var persons = from query in data.Descendants("Table")
select new Person
{
Phone = (string)query.Element("Phone"),
Name= (string)query.Element("Name"),
};
listBox1.ItemsSource = persons;
public class Person
{
string Phone;
string Name;
public string Phone
{
get { return phone; }
set { phone = value; }
}
public string ame
{
get { return name; }
set { name = value; }
现在我想做同样的事情,但 XML 文件位于 URL 上。
有人可以帮我吗?
谢谢
【问题讨论】:
标签: xml windows-phone-7