![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | passing multiple XML nodes to a binding converter Hi, I'm looking to implement something similar to an example by Bea Costa ( http://www.beacosta.com/blog/?p=35 ), but using an XML data source instead of a C# data model. Image my XML data source looking like this: <?xml version="1.0" encoding="UTF-8"?> <points> <point x="275" y="100" >A</point> <point x="375" y="200" >B</point> <point x="275" y="300" >C</point> <point x="175" y="200" >D</point> </points> In Bea's example, she binds to the C# data model like so: <Polygon Fill="#CD5C5C" Points="{Binding Source={StaticResource src}, Path=Points, Converter={StaticResource converter}}"/> I assumed I would be easily able to switch it to XML by defining my XmlDataProvider (with key="pts") and bind to it as such: <Polygon Fill="#CD5C5C" Points="{Binding Source={StaticResource pts}, XPath=points, Converter={StaticResource converter}}"/> However, this doesn't work. The value object passed to the converter appears as the string "ABCD". How can I get it to pass the converter a collection of point nodes instead of a concatenated list of the nodes content? I've been told to add "path=InnerXml" to the binding and then parse the resulting XML, but this strikes me as quite inelegant. Any ideas? Cheers, -robin |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| WLM losing messages between nodes | Live Messenger | |||
| LINQ to XML Add Nodes? | .NET General | |||
| Adding Attributes to nodes in XML | PowerShell | |||