You need to separate UI from data and other aspects of the application. Create some data model of the information edited in your UI. It could be just a set of some pure-data classes/structures. You UI should be aware of this model, but model unaware of the UI.
Now, develop, in the simplest case 1) initialization of the data instance of model (for a minute, forget persistence), 2) population of the UI from data, 3) update of the data from controls edited using this UI.
When this is done, you have all but persistence. For persistence, use
Data Contract:
http://msdn.microsoft.com/en-us/library/ms733127.aspx[
^].
This approach is the most non-intrusive, robust end easy to use. You won't need to modify your classes, will need just to add some attributes. You won't need to work with files and XML or JSON directly. The data contract serializer will simply store any arbitrary object graph according to contract (if does not even have to be a tree, could be anything, even with circular references) and restore it later as it was, from/to any stream of a file. Performance is also very good, based on generation assemblies on the fly with
System.Reflection.Emit
.
Please see my past answers advocating this approach:
How can I utilize XML File streamwriter and reader in my form application?[
^],
Creating property files...[
^],
deseralize a json string array[
^].
—SA