3
我現在用的是綁定的FlowDocument項的控制這裏找到:WPF的FlowDocument與ItemsPresenter
http://msdn.microsoft.com/en-us/magazine/dd569761.aspx
它完全像廣告;但是,我希望能夠擴展它。我希望能夠爲ItemsPanel指定一個ItemsPresenter,就像你爲ItemsControl一樣。我的目標是爲桌子添加頁腳。
使用網站上的例子:
<flowdoc:ItemsContent ItemsSource="{Binding Source= {StaticResource DataSource},XPath=FortressGuys/Person}" >
<flowdoc:ItemsContent.ItemsPanel>
<DataTemplate>
<flowdoc:Fragment>
<Table BorderThickness="1" BorderBrush="Black">
<TableRowGroup flowdoc:Attached.IsItemsHost="True">
<TableRow Background="LightBlue">
<TableCell>
<Paragraph>First name</Paragraph>
</TableCell>
<TableCell>
<Paragraph>Last name</Paragraph>
</TableCell>
</TableRow>
</TableRowGroup>
<TableRowGroup>
<!-- ITEMS PRESENTER -->
</TableRowGroup>
<TableRowGroup>
<TableRow>
<TableCell>
<Paragraph>My Amazing Footer</Paragraph>
</TableCell>
</TableRow>
</TableRowGroup>
</Table>
</flowdoc:Fragment>
</DataTemplate>
</flowdoc:ItemsContent.ItemsPanel>
<flowdoc:ItemsContent.ItemTemplate>
<DataTemplate>
<flowdoc:Fragment>
<TableRow>
<TableCell>
<Paragraph>
<flowdoc:BindableRun BoundText="{Binding [email protected]}" />
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
<flowdoc:BindableRun BoundText="{Binding [email protected]}"/>
</Paragraph>
</TableCell>
</TableRow>
</flowdoc:Fragment>
</DataTemplate>
</flowdoc:ItemsContent.ItemTemplate>
</flowdoc:ItemsContent>
這最終是這個樣子:
First Name Last Name
----------------------
Nancy Davolio
Andrew Fuller
----------------------
My Awesome Footer
有誰知道如何做到這一點來實現?