Wpf FlowDocument上的MouseDown事件向下滚动FlowDocumentScrollViewer
我有一个WPF窗口,其中有一个FlowDocumentScrollViewer,还有一个FlowDocument作为它的子窗口。当然,在FlowDocument元素中,我有网格、文本框等,它们都工作得很好,但是每当我单击它们时,滚动条就会一直向下滚动。守则如下:Wpf FlowDocument上的MouseDown事件向下滚动FlowDocumentScrollViewer,wpf,xaml,flowdocument,flowdocumentscrollviewer,Wpf,Xaml,Flowdocument,Flowdocumentscrollviewer,我有一个WPF窗口,其中有一个FlowDocumentScrollViewer,还有一个FlowDocument作为它的子窗口。当然,在FlowDocument元素中,我有网格、文本框等,它们都工作得很好,但是每当我单击它们时,滚动条就会一直向下滚动。守则如下: <FlowDocumentScrollViewer Grid.Row="1" Grid.Column="1"> <FlowDocument x:Name="fl
<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>
这种行为是不可取的,但我也不知道是什么原因造成的。如何防止这种情况发生?好吧,不是解决原因(目前还不清楚),而是解决问题本身,我通过删除
FlowDocument
和部分
,并通过ScrollViewer
切换FlowDocumentScrollViewer
使它停止向下滚动。对于我的需要来说,这是可能的,也足够了