我有一个ListBox.它有内部ScrollViewer,所以我可以用鼠标滚轮滚动ListBox内容.它工作正常,直到我设置包含另一个ListBox的项目模板(事实上,我有4个嵌套的ListBoxes =)).问题是内部ListBox的ScrollViewer窃取了转动事件.有没有简单的方法可以防止这种行为?
我有ListBox和ItemContainerStyle,如下所示:
<Style x:Key="ListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="BorderBrush" Value="Black"/>
...
</Style>
<ListBox ItemContainerStyle="{StaticResource ListBoxItemStyle}" />
Run Code Online (Sandbox Code Playgroud)
如何在这样的资源中为ItemContainer的项边框设置样式?据我所知,ContentPresenter是ItemsControl的项容器.但它没有边框,所以我无法设计它.