开发者

Two blocks on the same line in a FlowDocument

Is it possible to have two blocks (say, two Sections) rendered on the same line in a FlowDocument?

It seems to always start the second section on the next line and I can't seem to work around this.

A wrapper using InlineUIContainer might work, but what do I put in the InlineUIContainer? I ne开发者_开发知识库ed to render tens of thousands of these lines, so it needs to be relatively efficient.


Sounds like you should use a table.

E.g.

<Table>
  <Table.Columns>
    <TableColumn/>
    <TableColumn/>
  </Table.Columns>
  <TableRowGroup>
    <TableRow>
      <TableCell>
        <Section><Paragraph>First section</Paragraph></Section>
      </TableCell>
      <TableCell>
        <Section><Paragraph>Second section</Paragraph></Section>
      </TableCell>
    </TableRow>
  </TableRowGroup>
</Table>

You could either repeat the whole table every time you need this, or just add rows to the row group every time.

I haven't done any performance testing with tens of thousands of tables or a table with tens of thousands of rows. I have go to the range of about a thousand tables in a single flow document and the FlowDocumentReader maintains good performance up to that level.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜