【问题标题】:FlowDocument - Prevent breaks between paragraphsFlowDocument - 防止段落之间的中断
【发布时间】:2012-04-02 08:36:13
【问题描述】:

我有一个 FlowDocument,其中包含带有标题的列表:

Header 1           -   Item 2
-   Item 1         
-   Item 2         Header 3
-   Item 3         -   Item 1
                   -   etc.
Header 2
-   Item 1

我想防止页面/列中断,以便布局如下:

Header 1           Header 2
-   Item 1         -   Item 1
-   Item 2         -   Item 2
-   Item 3         
                   Header 3

我不希望包含标题的列表拆分为多个列或页面。我怎样才能做到这一点?

目前布局如下:

  • 段落(标题)
  • 列表
    • 列表项

【问题讨论】:

  • 只是猜测:您尝试过BreakColumnBefore 属性吗?此列表必须在段落内。
  • @Clemens 对不起,我不想插入中断,只是防止整个段落中断。

标签: wpf flowdocument


【解决方案1】:

设置KeepTogether 属性将防止段落内分栏或分页。

【讨论】:

  • 但是我不能在段落中插入一个列表:( 试图让 ItemsControl 起作用。
  • @Bas 你说得对,流文档模型不喜欢你想做的事情。
猜你喜欢
  • 1970-01-01
  • 2010-11-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-09-27
  • 2011-12-02
  • 1970-01-01
相关资源
最近更新 更多