我有一个 WPF 窗口,其中有一个 FlowDocumentScrollViewer,并有一个 FlowDocument 作为其子项。当然,在 FlowDocument 元素内部,我有网格、文本框等,它们都可以正常工作,但是每当我单击它们时,滚动条就会一直向下滚动。代码是这样的:
<FlowDocumentScrollViewer Grid.Row="1" Grid.Column="1">
<FlowDocument x:Name="flowDoc" PagePadding="0">
<Section>
<BlockUIContainer>
<Border BorderBrush="Red" BorderThickness="2">
<Grid x:Name="masterGrid" Height="1500">
<!--window structure here-->
</Grid>
</Border>
</BlockUIContainer>
</Section>
</FlowDocument>
</FlowDocumentScrollViewer>
这种行为是不希望的,但我也不知道是什么原因造成的。我如何防止它发生?