Change selection-color of WPF ListViewItem

后端 未结 4 2167
名媛妹妹
名媛妹妹 2020-12-06 00:39

I have a ListView containing some ListViewItems. By default, selecting items makes their background to some deep blue. I would like to apply a style such that selecting an i

4条回答
  •  忘掉有多难
    2020-12-06 00:57

    Have a look at this: http://www.wpftutorial.net/ListBoxSelectionBackground.html or http://dotnetbutchering.blogspot.be/2009/08/how-to-set-wpf-listview-selected-item.html -the same principle applies for the ListView control.

    For example, the following triggers based code should do the trick and imitate no change of colour when the selection is changed.

     
    

提交回复
热议问题