XML 文件读取数据并将其绑定到 WP7 应用中按钮单击事件的列表框控件



我对WP7应用程序开发非常陌生,并尝试读取xml文件数据并将其绑定到按钮单击事件上的listbox控件。

有人可以帮我解决这个问题吗?

这是我的 xml 文件格式:我想在单击按钮时将此xml的描述标签绑定到列表框控件。

<ROOT>
<COMPANY NAME="Mercedes Benz">
<Car NAME="A-Class—Hatchback">
<Description>
<![CDATA[ Mercedes Benz will launch the sporty A-Class hatchback, its entry level variant based on the MFA platform for the European market in September 2012.]]>
</Description> 
<COLOR>Red</COLOR>
<Car NAME="Mercedes-Benz G-Class">
<Description>
<![CDATA[ It's the midweek hump and for many a first day back to work, time to jump to action, here's a Mercedes-Benz G-Class in action to inspire to push on to the end of the week!]]>
</Description> 
<COLOR>BLACK</COLOR>
</COMPANY>
<COMPANY NAME="BMW">
<Car NAME="BMW X1">
<Description>
<![CDATA[ The sporty and elegant design of the all-new three-door model, along with additional engine choices, are distinguishing features that sharpen the unmistakable profile of the all-new BMW 1 Series (3-door) as the recognised standard of sheer driving pleasure in the premium compact car segment.]]>
</Description> 
<COLOR>BLUE</COLOR>
</COMPANY>
</ROOT>

任何帮助或建议将不胜感激。

谢谢苏德

请参阅本教程,它将对您有所帮助

http://www.windowsphonegeek.com/tips/wp7-working-with-xml-reading-filtering-and-databinding

最新更新