我有如下所示的 XML:
<showcases>
<showcase id="260">
<artistID>2143</artistID>
<venueID>29</venueID>
<startdatetime>2012-09-12 17:30:00</startdatetime>
<enddatetime>2012-09-12 18:00:00</enddatetime>
</showcase>
[etc]
</showcases>
在同一个 XML 文件中:
<showcaseartists>
<showcaseartist id="2129">
[other stuff about them]
</showcaseartist>
[etc]
</showcaseartists>
<venue id="19">
<name> ... </name>
<address> ... </address>
[etc]
</venue>
如何将这些数据放入列表中?
所以像这样:
var showcasedata = from query in loadedData.Descendants("showcase")
select new Showcase
{
StartDateTime = (DateTime)query.Element("startdatetime"),
ArtistName = ????,
Venue = ????
};
ShowcasesList.ItemsSource = showcasedata.ToList();
我想一定有办法,但我找不到!
谢谢。