populate a wpf combo with data from XAML

  • Thread starter Thread starter wpfRookie
  • Start date Start date
W

wpfRookie

Hello,
I would like to populate a wpf combo box from a data island in XAML.
I adapted an example I found on the net, like so:

<Window.Resources>
<XmlDataProvider x:Key="GreekHeroesData" XPath="GreekHeroes/Hero">
<x:XData>
<GreekHeroes xmlns="">
<Hero Name="Jason" />
<Hero Name="Hercules" />
</GreekHeroes>
</x:XData>
</XmlDataProvider>
</Window.Resources>

<ComboBox ItemsSource="{Binding Source={StaticResource GreekHeroesData}}"
</ComboBox>
</Window>

But the combo stays empty. What is wrong here?

Thanks for your help.
wpfRookie
 
Back
Top