Hi all,
I need some help. First time trying to bind xml file to Silverlight listbox.
Can't seem to get this to work...
Xml file
<?xml version="1.0" encoding="utf-8" ?>
<document>
<titles>
<title>First Page</title>
</titles>
<titles>
<title>Second Page</title>
</titles>
</document>
code below:
XDocument xmlTitles = XDocument.Load("Titles.xml");
var titles = from title in xmlTitles.Descendants("titles")
select new Slide {
Title = (string)title.Element("title")
};
pageList.SelectedIndex = -1;
pageList.ItemsSource = titles;
I get the following compile error on the XDocument.Load("Titles.xml");
Error: Could not find an implementation of the query pattern for source type
'System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement>'.
'Select' not found. Are you missing a reference to 'System.Core.dll' or a
using directive for 'System.Linq'?
-------------------------------------------------------------------
OzSilverlight.com - to unsubscribe from this list, send a message back to the
list with 'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net