WPF FlowDocument 对称布局
如何使用一个 FlowDocument 生成对称布局?
我的代码是:
<Grid Name="grid1">
<FlowDocumentScrollViewer Name="name1" Margin="6,0,17,0">
<FlowDocument>
<Paragraph>
<Figure HorizontalAnchor="PageLeft" VerticalAnchor="PageTop" Width="0.5content">
<BlockUIContainer>
<Button >HelloTwo</Button>
</BlockUIContainer>
</Figure>
<Figure HorizontalAnchor="PageRight" VerticalAnchor="PageTop" Width="0.5content">
<BlockUIContainer>
<Button >HelloTwo</Button>
</BlockUIContainer>
</Figure>
</Paragraph>
</FlowDocument>
</FlowDocumentScrollViewer>
</Grid>
我希望它们与每个内容的同一位置并排对齐。 我怎样才能实现这个布局?
How can a symmetric layout be generated using one FlowDocument?
My code is:
<Grid Name="grid1">
<FlowDocumentScrollViewer Name="name1" Margin="6,0,17,0">
<FlowDocument>
<Paragraph>
<Figure HorizontalAnchor="PageLeft" VerticalAnchor="PageTop" Width="0.5content">
<BlockUIContainer>
<Button >HelloTwo</Button>
</BlockUIContainer>
</Figure>
<Figure HorizontalAnchor="PageRight" VerticalAnchor="PageTop" Width="0.5content">
<BlockUIContainer>
<Button >HelloTwo</Button>
</BlockUIContainer>
</Figure>
</Paragraph>
</FlowDocument>
</FlowDocumentScrollViewer>
</Grid>
I want them to be aligned side-by-side with each one's content in the same position.
How can I achieve this layout?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该使用
FlowDocumentReader
或FlowDocumentPageViewer
。使用FlowDocumentScrollViewer
时,Figure
被视为不同的锚定块,并且不能并排配对。You should use
FlowDocumentReader
orFlowDocumentPageViewer
. UsingFlowDocumentScrollViewer
,Figure
is treated as different anchored block, and can't be paired side by side.