Listview inside of scrollviewer prevents scrollviewer scroll

后端 未结 5 1896
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-01 10:00

I have a scrollviewer with a couple listboxes in it. The problem is if a user uses the middle mouse roller to scroll the scrollviewer while their mouse is over a listview. T

5条回答
  •  猫巷女王i
    2021-01-01 10:59

    That happens because the ListView's (ListBox's, actually) content template wraps its items with a ScrollViewer by itself.

    The simplest way is to disable it by dropping your own Template for the inside ListView, one that doesn't create a ScrollViewer:

        
          
            
              
            
          
          ...
        
    

    BTW the same happens if you have a ListView inside a ListView (this was my case).

提交回复
热议问题