populate a wpf combo with data from XAML

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top