How to disable ListView's Hover and Tile effects?

后端 未结 2 1131
醉酒成梦
醉酒成梦 2021-01-19 01:48

I want to disable Tile effect that is some kind of pushed effect and hover background color effect of ListView control, how can i do that?

Thanks

2条回答
  •  孤独总比滥情好
    2021-01-19 02:21

    After some googling I found that the highlighting happens in the ListViewItemPresenter, which turns out to be pretty hidden. It's located inside the ControlTemplate of an ListViewItem, which is the ItemContainer for the ListView. The simplest way I've found to disable the effect is to simply override this ControlTemplate:

    
    
        
    
    
    ...
    
    

    source: https://blog.jonstodle.com/uwp-listview-without-highlighting-and-stuff/

提交回复
热议问题