Click here to Skip to main content
15,885,998 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
<?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>
Posted
Updated 3-Dec-13 2:19am
v2
Comments
Sergey Alexandrovich Kryukov 3-Dec-13 9:01am    
The question does not make much sense. WPF is a presentation framework, MVVM is an architectural pattern used, like other pattern of this class, mainly for UI isolation. Both are not the XML-binding tools. You need to explain what you want to achieve, exactly, and what is the problem.
—SA
bunty swapnil 3-Dec-13 9:13am    
I want to bind all the feature of xml into the list view control.

using mvvm pattern i have to read xml file and make list of available feature into xml file.
then this method want to bind with item source property of list view control.

1 solution

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[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900