For those who find this later, I solved this problem using the library in Nuget: https://github.com/JerryNixon/Template10.ListHelpers
This behavior uses separate styles for each state.
<Style x:Key="ItemNormalStyle" TargetType="Grid"> <Setter Property="RequestedTheme" Value="Dark" /> <Setter Property="Background" Value="{ThemeResource ButtonPointerOverBackgroundThemeBrush}" /> </Style> <Style x:Key="ItemSelectedStyle" TargetType="Grid"> <Setter Property="RequestedTheme" Value="Light" /> <Setter Property="Background" Value="{ThemeResource ButtonBackgroundThemeBrush}" /> </Style>
Using it is also quite simple. This is an attached property.
<ListView helpers:ListViewHelper.SelectedItemStyle="{StaticResource MySelectorInfo}" ItemTemplate="{StaticResource ListViewItemTemplate}" > <ListView.ItemContainerStyle> <Style TargetType="ListViewItem"> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property="Padding" Value="0" /> </Style> </ListView.ItemContainerStyle> </ListView>
// good luck
source share