2011-03-01 3 views
3

와 나는 바인딩 FlowDocument 항목을 사용하고 여기에 발견 제어 :WPF FlowDocument ItemsPresenter

http://msdn.microsoft.com/en-us/magazine/dd569761.aspx

그것은 광고로 완벽하게 작동합니다; 그러나, 나는 그것에 확장하기를 바랐다. ItemsControl과 같은 방법으로 ItemsPanel에 ItemsPresenter를 지정할 수 있기를 원합니다. 내 목표는 테이블에 바닥 글을 포함시키는 것입니다.

사이트에있는 예제를 사용 :

First Name Last Name 
---------------------- 
Nancy  Davolio 
Andrew  Fuller 
---------------------- 
My Awesome Footer 

사람이 성취 될 것이다 알고 있나요 :

<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> 

궁극적으로 다음과 같이 보일 것입니다 무엇입니까?

답변

4

추가로 검토 한 결과 대답을 발견했습니다. IsItemsHost 특성은 항목을 배치 할 위치를 컨트롤에 알립니다.

flowdoc:Attached.IsItemsHost="True" 

제 TableRowGroup에서 그 특성을 제거하고, 두 번째 행의 그룹에 추가

  <TableRowGroup flowdoc:Attached.IsItemsHost="True"> 

      <!-- ITEMS PRESENTER --> 

      </TableRowGroup> 
관련 문제