I am using the bindable FlowDocument control found here:
http://msdn.microsoft.com/en-us/magazine/dd569761.aspx
It works great as advertised; however, I was hoping to expand it. I want to specify the ItemsPresenter for the ItemsPanel, the same as for the ItemsControl. My goal is to include a footer for the table.
Using the example on the site:
<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>
</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 XPath=@FirstName}" />
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
<flowdoc:BindableRun BoundText="{Binding XPath=@LastName}"/>
</Paragraph>
</TableCell>
</TableRow>
</flowdoc:Fragment>
</DataTemplate>
</flowdoc:ItemsContent.ItemTemplate>
</flowdoc:ItemsContent>
What in the end would look something like this:
First Name Last Name
----------------------
Nancy Davolio
Andrew Fuller
----------------------
My Awesome Footer
Does anyone know how this will be achieved?
source
share