Reputation: 2122
I have a columned listview who's items I would like to store in an XML file.
What's the best way to go about loading, saving and adding items?
Upvotes: 1
Views: 469
Reputation: 3777
best way is to use MVVM :), that way your View simply represents the data in the UI. Actual DomainModel/BusinessObject resides outside your View.
And then you can use number of persistance methods:
XML Serialization
ORM (Object Relation Mapping), which will persist/save the BusinessObject into Database and back
Step by step way:
Create/Define your BusinessObject(DomainModel, i.e. Person class)
Use DataTemplate to Bind to Collection from your ListView
In your ViewModel, you can than say PersonCollection.Save/Load etc
Upvotes: 1