<Grid>
<FlowDocumentScrollViewer>
<FlowDocument>
<Paragraph>
<Floater Width="130" HorizontalAlignment="Left" Margin="0,0,5,5" Padding="3">
<BlockUIContainer>
<Image Source="/FlowDocumentTest;component/dog.png" Width="100" />
</BlockUIContainer>
</Floater>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse et diam felis. Vestibulum ac nisl mi.
Etiam varius velit lobortis nibh vestibulum nec consequat velit pellentesque.
Cras commodo libero placerat nulla dapibus eget porttitor ligula tempor.
Donec nisl massa, congue et pretium sit amet, feugiat vel est.
Nulla dapibus metus in justo pulvinar sit amet viverra lorem rhoncus.
Integer placerat interdum massa et mattis.</Paragraph>
</FlowDocument>
</FlowDocumentScrollViewer>
</Grid>
2条答案
按热度按时间fkaflof61#
我不建议使用TextBlocks来实现这种布局。正如Kieren所建议的,FlowDocument将是这种设计的理想选择。看看这个XAML代码片段,以及使用FlowDocument、Paragraph元素和包含图像的Floater元素所生成的WPF应用程序屏幕截图:
xdyibdwo2#
在代码隐藏中尝试以下操作: