FlowDocument - 如何实现 KeepWithNext

发布于 2024-12-02 10:25:57 字数 444 浏览 2 评论 0原文

我有一个 FlowDocument,其中包含多个彼此背靠背的 BlockUIContainer。这些 UIContainer 各自代表来自不同来源的不同类型的内容,但都是相关的,我希望它们在页面上保持在一起。换句话说,我不希望它们在页面之间分开。

Paragraph 类有一个名为 KeepWithNext 的属性,该属性将确保其后面的段落始终与给定段落保持在同一页面上。

我想将此功能添加到 BlockUIContainer(或子类 BlockUIContainer 来添加它),但我不知道如何将 KeepWithNext 属性用于 Paragraph 类。

我尝试使用 Reflector 来获得一些见解,但据我所知,它只是一个布尔属性,在 Paragraph 类中没有实际用途。这让我相信分页器以某种方式知道如何处理该属性。

有谁知道我应该如何处理这个问题?我应该在哪里查找我需要做什么来匹配段落功能?

I have a FlowDocument with multiple BlockUIContainers back to back with one another. These UIContainers each represent a different type of content coming from a different source, but are all related and I would like them to stay together on a page. To word it differently, I don't want them split between pages.

The Paragraph class has a property called KeepWithNext that will make sure that the paragraph that follows it always stays on the same page as the given paragraph.

I would like to add this functionality to the BlockUIContainer (or subclass BlockUIContainer to add it) but I don't know how the KeepWithNext property gets used for the Paragraph class.

I've tried using Reflector to get some insight, but as far as I can tell it's just a boolean property with no real usage inside of the Paragraph class. This leads me to believe that the paginator somehow knows what to do with the property.

Does anyone have a clue about how I should approach this? Where should I look to find out what I need to do to match the Paragraph functionality?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风和你 2024-12-09 10:25:57

我不确定内部分页是如何工作的,但是...

与扩展 BlockUIContainer 不同,使用 Paragraph 上现有的 KeepWithNext 属性可能会更容易 并将您的 BlockUIContainers 转换为 Paragraphs 内的 InlineUIContainers

I'm not sure how the internal pagination works, but...

Instead of extending BlockUIContainer, it may be much easier to use the existing KeepWithNext property on Paragraph and convert your BlockUIContainers to InlineUIContainers inside Paragraphs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文