This is my XML data:
<?xml version="1.0" encoding="utf-8" ?>
<Teams xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CountryList>
<CountryName>UK</CountryName>
<CountryName>USA</CountryName>
</CountryList>
<Team>
<Name>Arizona Cardinals</Name>
</Team>
<Team>
<Name>Atlanta Falcons</Name>
</Team>
</Teams>
How to fill tow listboxes one with name and another with CountryName.
I tried below
<Grid.DataContext>
<XmlDataProvider x:Name="TeamData" Source="Data\XMLData.xml"/>
</Grid.DataContext>
<Window.Resources>
<DataTemplate x:Key="teamItemTemplate">
<Label Content="{Binding XPath=//Teams/Team/Name}"/>
</DataTemplate>
<DataTemplate x:Key="CountryListTemplate">
<Label Content="{Binding XPath=//Teams/CountryList/CountryName}"/>
</DataTemplate>
</Window.Resources>
But it adds only the first data.
Please help..