0

The program I am writing is simple. There is an XML source file-the users need a GUI for changing the details and they need the ability to edit the XML file also. So the program will have two tabs-one is a GUI and the other an XML editor. If the user changes something in the GUI it has to be reflected in the XML editor and if the XML in the XML editor is changed it has to be reflected in the GUI too.

I used XSD.exe to generate the classes for the XML and tried serialization and deserialization on tab changed event. Though it works I am finding the lag(becasue of serilaization/deserialization) while changing the tab a little annoying. Is there a better way to do this?

Jimmy
  • 3,224
  • 5
  • 29
  • 47

1 Answers1

0

If it were me I would start by using an XmlDocument or an XDocument as the data source for your object model used by the GUI.

Here's a similar question with a great answer showing this type of concept.

Creating a WPF editor for XML file based on schema

You'll still have to handle the tab/view switching to save the xml file or reload it. But with the data binding a lot of the work is done for you once you setup your object model.

Community
  • 1
  • 1
dblood
  • 1,758
  • 17
  • 21