Set WPF Resources in C #

How to do the following through C # (since I generate ListViews programmatically):

<ListView> <ListView.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent"/> <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent"/> </ListView.Resources> ... 
+4
source share
1 answer

I am still participating in WPF, but you can try the following:

  ListView view = new ListView(); view.Resources.Add(SystemColors.HighlightBrushKey, new SolidColorBrush(Colors.Transparent)); view.Resources.Add(SystemColors.ControlBrushKey, new SolidColorBrush(Colors.Transparent)); 
+2
source

All Articles