What you have to do for specifying a background color for highlighting an item of a ListView is simply add to your <ListView.Resources> the following SolidColorBrush:

        <ListView ScrollViewer.VerticalScrollBarVisibility="Visible"
                  x:Name="myListView"
                  ItemsSource="{Binding Path=myFileCollection}">

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

        </ListView>

The first SolidColorBrush overrides the Windoes Highlight Brush for indicating a selected item having the focus. The second SolidColorBrush is used for overriding the default Windows Brush used for indicating a selected item that doesn’t have a focus.

Advertisements