views:

191

answers:

0

Guys,

I have a Window with an XmlDataProvider containing a data island. I want to read the XML from the code-behind. I have inspected all the properties of XmlDataProvider. I must be missing something. How can I do this?

My Code-Behind:

//how do I get the XML data island into a string? This does nothing...
        var s = sp.Resources["InventoryData"] as XmlDataProvider;
        var ss = s.XmlSerializer;            
        XmlWriter w = XmlWriter.Create(@"c:\test.txt");
        ss.WriteXml(w);
        w.Close();

My XAML (Posted as link since SO cannot display properly)

XAML Snippet