我想创建聊天程序,消息可以以不同的方式显示,特别是在WP7下的IM+。但我在迷雾中,选择哪一种控制。平台:.NET 4.0,WPF app。PS:我发现FlowDocumentScrollViewer有些沉重,还有其他的建议吗?(或者是如何使用FlowDoc的好例子)。
发布于 2012-01-25 05:54:22
初学者:WPF Flow Document For Beginners。
来自同一作者的一个高级示例:WCF / WPF Chat Application。
最简单的流文档示例:
<!-- This simple flow document includes a paragraph with some
bold text in it and a list. -->
<FlowDocumentReader xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<FlowDocument>
<Paragraph>
<Bold>Some bold text in the paragraph.</Bold>
Some text that is not bold.
</Paragraph>
<List>
<ListItem>
<Paragraph>ListItem 1</Paragraph>
</ListItem>
<ListItem>
<Paragraph>ListItem 2</Paragraph>
</ListItem>
<ListItem>
<Paragraph>ListItem 3</Paragraph>
</ListItem>
</List>
</FlowDocument>
</FlowDocumentReader>发布于 2012-01-25 06:02:59
我只需要为每条消息添加一个TextBlock。
TextBlock可以包含多种不同样式的文本,因此您仍然可以支持粗体、斜体、颜色、超链接等内容。
https://stackoverflow.com/questions/8991619
复制相似问题