XAML 标记:
<RichTextBox HorizontalAlignment="Left" Height="120" Margin="359,554,0,0" VerticalAlignment="Top" Width="306" Name="duplicateCompXMLVarRichTextBox">
<FlowDocument>
<Paragraph>
<ItemsControl ItemsSource="{Binding Value}"/>
<!-- <ItemsControl ItemsSource="{Binding Key}"/> -->
</Paragraph>
</FlowDocument>
</RichTextBox>
代码隐藏:
Dictionary<string, List<string>> componentXMLDuplicates = new Dictionary<string, List<string>>();
componentXMLDuplicates= Helper.PopulateCollectionWithData();
duplicateCompXMLVarRichTextBox.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
duplicateCompXMLVarRichTextBox.DataContext = componentXMLDuplicates;
这里的问题是我只能在 WPF 窗口中显示字典集合的键或值。是否有可能使用正确的格式或它们之间的空格同时显示两者?有什么建议么?