WPF 中的文本系统主要是为在 UI 中使用文本而设计的,而不是用于生成带有脚注和标题等的复杂文档。但是,该框架已经编写,因此如果您想添加自定义功能,您可以。
第一个问题:脚注和与文本一致的东西。WPF 提供了 2 个类来将UIElement
s 放入文本中:InlineUIContainer
和BlockUIContainer
. 我会考虑编写自己的自定义控件,该控件专门设计为具有脚注或类似行为的行为,并将其放在这两个类之一中。如果您需要有关接受什么的更多信息,我在 MSDN 上找到了这个方便的关系图表(链接在页面底部)

(来源:microsoft.com)
我不完全确定您所说的“杂志式故事流”是什么意思。'FlowDocument' 将自动将Block
派生类(上图中蓝色的任何内容)排列到可用空间中,您可以使用Floater
和Figure
inline 元素使文本在对象周围“流动”。您还可以将Figure
andFloater
用于您的页眉和页脚功能。
这是一些示例代码:
<FlowDocumentScrollViewer>
<FlowDocument>
<Paragraph>
5 green bottles standing on the wall,
5 green bottles standing on the wall,
and if one green bottle was to accidentally fall,
there would be 4 green bottles standing on the wall;
</Paragraph>
<Paragraph>
4 green bottles standing on the wall,
4 green bottles standing on the wall,
<Floater HorizontalAlignment="Left" Width="250">
<BlockUIContainer>
<Button>This button is in a Floater</Button>
</BlockUIContainer>
</Floater>
and if one green bottle was to accidentally fall,
there would be 3 green bottles standing on the wall;
</Paragraph>
<Paragraph>
3 green bottles standing on the wall,
3 green bottles standing on the wall,
and if one green bottle was to accidentally fall,
there would be 2 green bottles standing on the wall;
</Paragraph>
<Paragraph>
2 green bottles standing on the wall,
2 green bottles standing on the wall,
and if one green bottle was to accidentally fall,
<InlineUIContainer>
<Button>This Button is inline</Button>
</InlineUIContainer>
there would be 1 green bottle standing on the wall...
</Paragraph>
</FlowDocument>
</FlowDocumentScrollViewer>
您可以将Button
s 替换为您自己的自定义控件(例如,带有脚注的内联按钮)
这段代码是这样的:

我希望这会有所帮助!我不确切知道您要做什么,但我认为您仍然可以使用FlowDocument
并仅使用 WPF 提供的大量文本操作设备,如果您确实需要额外的功能/布局选项,请创建一个新类继承Block
或Inline
或其他任何东西,并在那里写下额外的东西,以利用 .net 可以为您做的所有工作。如果您需要更多信息,可以在 MSDN 上阅读有关 WPF 中文本内容的更多信息:
关于如何使用 FlowDocument 的超长文章
WPF 中使用的文本内容模型(我从中获取图像)
玩的开心 :)