1
標記爲XAML的鍵和值:數據綁定字典收集到RichTexbox呈現出集合
<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窗口中。是否有可能在兩者之間使用適當的格式或空格同時顯示?有什麼建議麼?
超人! @nit非常感謝:)。一旦stackoverflow允許我將此標記爲批准。 – Sike12