XML
を定義するファイルを指定して、次の XAML を説明して修正できますかComboBox ItemsSource
?
XAML:
<ComboBox Name="cbConnection" DataContext="{Binding Source=c:\temp\ConnectionList.xml, XPath=DBConnection}" ItemsSource="{Binding XPath=ComboItem}" DisplayMemberPath="Key" SelectedValuePath="Value">
c:\temp\ConnectionList.xml:
<?xml version="1.0" encoding="utf-8" ?>
<DBConnection>
<ComboItem>
<Key>Computer-A</Key>
<Value>Server=COMPA;Database=MyDB;Integrated Security=SSPI;</Value>
</ComboItem>
<ComboItem>
<Key>Computer-B</Key>
<Value>Server=COMPB\SQL2012STD;Database=MyDB;Integrated Security=SSPI;</Value>
</ComboItem>
</DBConnection>