我有一些代码可以绑定到 observablecollection。问题是我只得到一行而不是几行(意味着显示可观察集合中的所有元素)。如何获取可观察集合的所有行?
<FlowDocumentScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" FontFamily="Arial" BorderThickness="0" >
<FlowDocument>
<Table Name="myTable" FontFamily="Calibri" BorderThickness="3" BorderBrush="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" DataContext="{Binding}">
<Table.Columns>
<TableColumn/>
<TableColumn/>
<TableColumn/>
<TableColumn/>
<TableColumn/>
<TableColumn/>
<TableColumn/>
<TableColumn/>
<TableColumn/>
</Table.Columns>
<TableRowGroup DataContext="{Binding}">
<TableRow>
<TableCell>
<Paragraph>
<Run Text="{Binding Activity_Name}"/>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
<Run Text="{Binding Data_Type}"/>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
<Run Text="{Binding Insert_Succeeded}"/>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
<Run Text="{Binding Insert_Failed}"/>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
<Run Text="{Binding Update_Succeeded}"/>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
<Run Text="{Binding Update_Failed}"/>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
<Run Text="{Binding Delete_Succeeded}"/>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
<Run Text="{Binding Delete_Failed}"/>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
<Run Text="{Binding Skipped}"/>
</Paragraph>
</TableCell>
<TableRow>
</TableRowGroup>
</Table>
</FlowDocument>
</FlowDocumentScrollViewer>