Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用通过包含 StackPanel 的 ScrollViewer 设置样式的 ListBox。
为了允许滚动,它使用RepeatButtons 来调用ScrollBar.LineUpCommand 和ScrollBar.LineDownCommand。
控件显示正确,按钮使 ScrollViewer 滚动。
但是每次按下按钮只会使列表滚动不到一个项目。
如何设置 ScrollBar.SmallChange 以匹配 ListBoxItem 的高度?
StackPanel正在实现IScrollInfo,因此您可以CanContentScroll="True"在滚动查看器上进行设置,它将有关滚动的信息传递到堆栈面板。
StackPanel
IScrollInfo
CanContentScroll="True"
正在按项目StackPanel高度滚动。