使用触摸时,ComboBox 弹出窗口中的 ScrollViewer 从一开始就溢出

ScrollViewer inside ComboBox popup overflows right back from the start when using touch

我在 ComboBox 的 Popup 中嵌套了一个 ScrollViewer。我相信这是一个标准的设计。即使没有任何 DependencyProperties 设置,此 ScrollViewer 在使用触摸手势滚动时也会有特殊行为。

当我使用触摸并到达上述弹出窗口中 ComboBoxItems 的末尾时,ScrollBar 移回弹出窗口的开头并继续滚动。像那样:

我开始相信这是一种标准行为。如您所见,英语是列表中的第一种语言,波兰语和保加利亚语是列表中的最后一种语言。你能告诉我这种行为的名称是什么吗?可以关掉吗?

我会 post ComboBox 样式,但我认为这不重要,因为它的结构在很大程度上与默认样式相匹配:C:\Program Files (x86)\Windows Kits\DesignTime\CommonConfiguration\Neutral\UAP.0.18362.0\Generic\generic.html

提前致谢!

When I use touch & I reach the end of the ComboBoxItems inside aforementioned popup, ScrollBar moves back to the start of the popup and continues scrolling

它是 ComboBox 触摸模型控件中的设计使然。 ComboBox 默认使用 CarouselPanel 作为 ItemsPanel。它将使列表循环滚动。如果您想禁用此功能,请将 CarouselPanel 替换为 StackPanel

<ComboBox.ItemsPanel>
   <ItemsPanelTemplate>
      <StackPanel Orientation="Vertical" />
   </ItemsPanelTemplate>
</ComboBox.ItemsPanel>