i m trying hard to load comboBox items from an xml file. Here is my code:
<Grid>
<Grid.Resources>
<XmlDataProvider x:Key="ScenesXml" XPath="scenari-list/scenario" Source="http://192.168.40.18/LeafHouse/scenari-appartamento-5.xml"/>
</Grid.Resources>
<ComboBox Name="scenariCombo" VerticalAlignment="Center" Width="120"
ItemsSource="{Binding Source={StaticResource ScenesXml}}" DisplayMemberPath="@name" />
</Grid>
此处简化了Xml文档:
<scenari-list>
<scenario name="Fuori casa" value="fuori-casa">
...
</scenario>
<scenario name="Party" value="party">
...
</scenario>
<scenario name="ciao" value="ciao">
...
</scenario>
</scenari-list>
I want scenario s names to appear inside the combobox.
I found the code i provided in lots of questions but it doesn t work for me.
Anyone can help?