开发者

FlowDocument - How to Implement KeepWithNext

开发者 https://www.devze.com 2023-04-01 03:50 出处:网络
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 a

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 re开发者_如何学Cal 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?


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.

0

精彩评论

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

关注公众号