如何将XML数据填充到列表框中,以及WPF和MVVM模式 [英] how to populate XML data into listbox throgh WPF and MVVM Pattern

查看:142
本文介绍了如何将XML数据填充到列表框中,以及WPF和MVVM模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi


如何将XML数据填充到listview throgh WPF和MVVM Pattern。



i有这个xml我想要的在listview中显示功能(通过严格的MVVM)



任何通过mvvm将数据填充到列表视图中的演示或链接将不胜感激。





hi
how to populate XML data into listview throgh WPF and MVVM Pattern.

i have this xml i want to display feature in listview(through strictly MVVM)

any demo or link of populating data into a listview through mvvm will be appreciated.


<?xml version="1.0" encoding="utf-8" ?>
<Vehicle>
   <feature id = "1" name = "car">
     <propery id = "1" name = "Model Number"/>
     <property id = "2" name = "Color of car"/>
   </feature>
   <feature id = "2" name = "Bike">
      <property id = "1" name = "Model of bike"/>
      <property id ="2" name = "Compnay name"/>
   </feature>
</vehicle>

推荐答案

您可以像绑定到列表对象一样绑定到XML。



这是一篇文章,讨论如何使用LINQ绑定。



http://msdn.microsoft.com/en-us/library/bb669133.aspx [ ^ ]
you can bind to XML like you bind to a list object.

Here's an article that talks about how to use LINQ to bind.

http://msdn.microsoft.com/en-us/library/bb669133.aspx[^]


这篇关于如何将XML数据填充到列表框中,以及WPF和MVVM模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆