I have a ComboBox in WPF that gets data from XML as shown below.
<?xml version="1.0"?> <Root> <Book> <Name>Title1</Name> <Name>Title2</Name> <Name>Title3</Name> </Book> </Root> <ComboBox x:Name="cb_Book" ItemsSource="{Binding Source={StaticResource XmlData}, XPath=./Book/Name}"/> I would like to merge a static default text along with items retrieved from XML. I had tried few approaches like CompositeCollection shown here but was unsuccessful. Is there a best way to do this (preferably all in XAML)?
At the end ComboBoxItems should look like this:
Title1 #from XML Title2 #from XML Title3 #from XML MoreTitle #Static Default text
No comments:
Post a Comment