Question: Please help! I am working on a WPF project which involves binding to an XML file. The thing I need help with is taking the

Please help! 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.

Here is what the screen looks like. I am using a datatemplate to show all the info in a scroll viewer. The thing I dont understand is how to save the information from the second abilty since I am only referenceing so many textboxes?

Please help! I am working on a WPF project which involves binding

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:

Fireball Goodness gracious, great balls of fire. Fireball.py Deadly Strike Strike the target in the heart, twice. DeadStrike.py Gut Punch Punch your target in the gut. GutPunch.py Fighter ABI_02 Wizard ABI_01 Monk ABI_02 BattleMage ABI_01 ABI_03 Fisher Bob Human CLS_01 20 false APP_23 100 120 Captain Adventure Yeti CLS_03 99 false APP_910 200 500 true false Elf Dwarf Human Halfling Troll

NPC Editor Abilities: Back Ability ID ABI 01 Display Name: Fireball Flavor Text: Goodness gracious, great balls of fire Script ID Fireball py Ability ID ABI 03 Display Name: Deadly Strike Save All Changes NPC Editor Abilities: Back Ability ID ABI 01 Display Name: Fireball Flavor Text: Goodness gracious, great balls of fire Script ID Fireball py Ability ID ABI 03 Display Name: Deadly Strike Save All Changes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!