How to change Highlight color of the selected ListView item in UWP (Windows 10)

后端 未结 4 1724
青春惊慌失措
青春惊慌失措 2020-12-01 15:34

I\'m working on a Windows 10 app using C# and XAML. I have a ListView and I want to change the default HighLight color of an selected item. I was seeing many code examples (

4条回答
  •  情话喂你
    2020-12-01 16:30

    To extend on bastecklein's Answer. You want to use App instead of Application for this method to work in a UWP project. You can use this code in your App.xaml.cs as you load your initial frame, or you can just set the resource color on the code behind the page that you want to affect.

    App.Current.Resources["SystemControlHighlightListAccentLowBrush"] = new SolidColorBrush(Colors.Red);
    App.Current.Resources["SystemControlHighlightListAccentMediumBrush"] = new SolidColorBrush(Colors.Red);
    

提交回复
热议问题