WPF中的文本系统主要用于在UI中使用文本,而不是用脚注和头文件等生成复杂文档。但是,框架已经编写完成,因此如果您想添加自定义功能,您可以。
第一个问题:脚注和与文本一致的东西。 WPF提供了两个类,用UIElement
表示文字:InlineUIContainer
和BlockUIContainer
。我会考虑编写自己的自定义控件,它是专门设计用来具有脚注或类似行为的行为,并将其放在这两个类中的一个中。我发现这个MSDN方便,花花公子关系图,如果你需要“杂志上什么是接受(链接在页面的底部)
alt text http://i.msdn.microsoft.com/dynimg/IC66504.png
更多信息我不能完全明白你的意思风格故事流程“。 'FlowDocument'会自动将Block
派生的类(上图中的蓝色部分)排列到可用空间中,并且可以使用Floater
和Figure
内联元素在对象周围创建文本'流'。您还可以使用Figure
和Floater
作为页眉和页脚功能。
下面是一些示例代码:
<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(例如。与你的注脚胜内嵌按钮)
这段代码是: alt text http://www.freeimagehosting.net/uploads/5d5a85e395.jpg
我希望帮助!我并不确切知道你在做什么,但我认为你仍然可以使用FlowDocument
,只是使用WPF提供的大量文本操作设备,如果你确实需要额外的功能/布局选项,可以创建一个新的类继承Block
或Inline
或其他什么,并写在那里的额外的东西,以利用所有的工作.net可以为你做。 如果您需要了解更多信息,你可以阅读更多关于在WPF文字上的东西MSDN:
Extra long article about how to use FlowDocument
The text content model used in WPF (where I got the image from)
享受自己:)
谢谢。问题是Floater不允许控制放置,而图坚持把所有东西放在一个页面上。我需要两者的结合。 – yclevine 2010-07-23 08:34:59
杂志风格的流程是指在后面的页面上继续其他内容的故事。 – yclevine 2010-07-23 08:42:20
嗯然后我不知道,你可以创建自己的自定义浮动图形的东西,从Inline派生,并自己编写专门的代码...这将意味着你将获得自定义功能,而不必重写整个文本显示系统 – 2010-07-23 11:42:07