Question: I am working on a WPF project which involves binding to an XML file. The thing I need help with is taking the user input
I am working on a WPF project which involves binding to an XML file. The thing I need help with is taking the user input and saving it to the XML file. I am using a datatemplate to show all the info in a scroll viewer. How exactly would I take the user input for each box in all abilities not just the first ability?
Here is my code which is not much just setting up the xml document.
private void saveNPCButton_Click(object sender, RoutedEventArgs e) {
XmlDocument myXML = new XmlDocument();
XmlDataProvider xmlDP = (XmlDataProvider)FindResource("XDP");
myXML.Load("GameData.xml");
xmlDP.Document = myXML;
xmlDP.XPath = "Data";
}
How would I be able to save everything to the xml file?
Here is my XML:
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
