I need selected item of Listbox1 to provide XmlDataprovider source for second Listbox.
Listbox1 uses:
<XmlDataProvider x:Key="CategoryXML"
Source="C:\Category.xml"
XPath="category"
/>
Ex: Category.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<main>
<category>
<name>Local</name>
<XmlFileName>C:\Doc1.xml</XmlFileName>
</category>
<category>
<name>National</name>
<XmlFileName>C:\Doc2.xml</XmlFileName>
</category>
<category>
<name>Global</name>
<XmlFileName>C:\Doc3.xml</XmlFileName>
</category>
</main>
xaml:
<ListBox ItemsSource="{Binding Source={StaticResource CategoryXML},XPath=//main//category}"
SynchronizedWithCurrentItem="True" Name="CategoryList">
ListBox2:
<XmlDataProvider x:Key="itemXML"
Source="?" **XmlFileName of select item in Listbox1**
XPath="item"
/>
The problem I'm having is finding the correct syntax for making XmlFileName the source for itemXML. The user will select the <name>
in ListBox1 and send the <XmlFileName>
to itemXML which feeds Listbox2