Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When having a clickable textblock in a listview, there is a blue highlight around the text block that appears before hovering over the actual text. How would I remove the highlight (or glow if that is the proper term)?
<Grid x:Name="menuGrid">
    <ListView Template="{DynamicResource MenuListViewTemplate}" ItemsSource="{Binding MenuHeaders}" Name="Menu" SelectionChanged="Menu_SelectionChanged">
        <ListView.Style>
            <Style TargetType="{x:Type ListView}">
                <Setter Property="Background" Value="Navy"/>
                <Setter Property="BorderBrush" Value="Navy"/>
            </Style>
        </ListView.Style>
        <ListView.ItemsPanel>
            <ItemsPanelTemplate>
                <StackPanel Orientation="Horizontal"/>
            </ItemsPanelTemplate>
        </ListView.ItemsPanel>
        <ListView.ItemTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding HeaderName}">
                    <TextBlock.Style>
                        <Style TargetType="{x:Type TextBlock}">
                            <Setter Property="Foreground" Value="White"/>
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="OverridesDefaultStyle" Value="True"/>
                                    <Setter Property="TextDecorations" Value="Underline"/>
                                    <Setter Property="FontWeight" Value="Bold"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </TextBlock.Style>
                </TextBlock>
            </DataTemplate>
        </ListView.ItemTemplate>
        <ie:Interaction.Triggers>
            <ie:EventTrigger EventName="SelectionChanged">
                <ie:InvokeCommandAction Command="{x:Static event:GlobalCommands.SelectedCommand}"
                                        CommandParameter="{Binding ElementName=Menu, Path=SelectedItem}"/>
            </ie:EventTrigger>
        </ie:Interaction.Triggers>
    </ListView>
</Grid>


What I have tried:

I've tried in a few different places to make the highlight transparent or turn it off to the best of my knowledge.
Posted
Comments
[no name] 18-Jun-21 16:17pm    
Without a working example, this is something only you see.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900