tags:

views:

392

answers:

1

How do I do the following via C# (as I'm generating ListViews programatically):

<ListView>
    <ListView.Resources>
        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent"/>
        <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent"/>
    </ListView.Resources>
...

Thanks in advance!

+1  A: 

I'm still learning to WPF, but you might try this:

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