通常在XAML中绑定我们需要提供FIELDNAME,但是在这种情况下我们有类似
的值Dictionary["xyz"]["abc"]
那么有没有办法在XAML中添加Dictionary["xyz"]["abc"]
?
答案 0 :(得分:1)
假设您ItemsSource
设置为Dictionary<string, Dictionary<string, SOME_TYPE>>
。在这种情况下,您可以绑定到Key
和Value
,其中Value
将是Dictionary<string, SOME_TYPE>
。
然后,您可以将DataTemplate中的元素DataContext
绑定到Value
,并将属性绑定设置为Key
。儿童词典的1}}或Value
。