Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you have the Windows SDK installed, you can find the XAML source for all default styles (assuming you installed the samples) in:</p> <blockquote> <p>%ProgramFiles%\Microsoft SDKs\Windows\v6.1\Samples\WPFSamples.zip</p> </blockquote> <p>The zip file contains a folder Core which contains AeroTheme, LunaTheme etc which contain the source for default styles. Unfortunately these files are pretty large (~8500 lines for Aero) and not very well structured or formatted (IMO).</p> <p>The default control template for a ListViewItem looks like this:</p> <pre><code>&lt;ControlTemplate TargetType="{x:Type ListViewItem}"&gt; &lt;Border CornerRadius="2" SnapsToDevicePixels="True" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"&gt; &lt;Border Name="InnerBorder" CornerRadius="1" BorderThickness="1"&gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition MaxHeight="11" /&gt; &lt;RowDefinition /&gt; &lt;/Grid.RowDefinitions&gt; &lt;Rectangle Name="UpperHighlight" Visibility="Collapsed" Fill="#75FFFFFF" /&gt; &lt;GridViewRowPresenter Grid.RowSpan="2" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /&gt; &lt;/Grid&gt; &lt;/Border&gt; &lt;/Border&gt; &lt;ControlTemplate.Triggers&gt; &lt;Trigger Property="IsMouseOver" Value="True"&gt; &lt;Setter Property="Background" Value="{StaticResource ListItemHoverFill}" /&gt; &lt;Setter Property="BorderBrush" Value="#FFCCF0FF" /&gt; &lt;Setter TargetName="UpperHighlight" Property="Visibility" Value="Visible" /&gt; &lt;/Trigger&gt; &lt;Trigger Property="IsSelected" Value="True"&gt; &lt;Setter Property="Background" Value="{StaticResource ListItemSelectedFill}" /&gt; &lt;Setter Property="BorderBrush" Value="#FF98DDFB" /&gt; &lt;Setter TargetName="InnerBorder" Property="BorderBrush" Value="#80FFFFFF" /&gt; &lt;Setter TargetName="UpperHighlight" Property="Visibility" Value="Visible" /&gt; &lt;Setter TargetName="UpperHighlight" Property="Fill" Value="#40FFFFFF" /&gt; &lt;/Trigger&gt; &lt;MultiTrigger&gt; &lt;MultiTrigger.Conditions&gt; &lt;Condition Property="IsSelected" Value="True" /&gt; &lt;Condition Property="Selector.IsSelectionActive" Value="False" /&gt; &lt;/MultiTrigger.Conditions&gt; &lt;Setter Property="Background" Value="{StaticResource ListItemSelectedInactiveFill}" /&gt; &lt;Setter Property="BorderBrush" Value="#FFCFCFCF" /&gt; &lt;/MultiTrigger&gt; &lt;MultiTrigger&gt; &lt;MultiTrigger.Conditions&gt; &lt;Condition Property="IsSelected" Value="True" /&gt; &lt;Condition Property="IsMouseOver" Value="True" /&gt; &lt;/MultiTrigger.Conditions&gt; &lt;Setter Property="Background" Value="{StaticResource ListItemSelectedHoverFill}" /&gt; &lt;Setter Property="BorderBrush" Value="#FF98DDFB" /&gt; &lt;/MultiTrigger&gt; &lt;Trigger Property="IsEnabled" Value="False"&gt; &lt;Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" /&gt; &lt;/Trigger&gt; &lt;/ControlTemplate.Triggers&gt; &lt;/ControlTemplate&gt; </code></pre> <p>Your best bet for removing all highlighting is probably to replace the ControlTemplate with you own that just includes the GridViewRowPresenter (maybe in a single Border). Don't forget to include the Trigger that greys the items when the control is disabled.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload