伪例如:在xaml中创建一个词典?
<Window>
<Window.Tag>
<x:Dictionary KeyType="{x:Type sys:String}" ValueType="{x:Type sys:Int32}">
<sys:DictionaryEntry Entry="{sys:DictionaryEntry Key0, 000}"/>
<sys:DictionaryEntry Key="key1" Value="111"/>
<sys:DictionaryEntry>
<sys:DictionaryEntry.Key>
<sys:String>Key2<sys:String>
</sys:DictionaryEntry.Key>
<sys:DictionaryEntry.Value>
<sys:Int32>222</sys:Int32>
</sys:DictionaryEntry.Value>
</sys:DictionaryEntry>
</x:Dictionary />
</Window.Tag>
</Window>
更多了最新的讨论在https://stackoverflow.com/问题/ 2494823/binding-dictionaryt-to-a-wpf-listbox – Ben 2018-02-26 19:14:48