wpf listview 行变色

<ListView x:Name="listView_Date" Grid.Row="3" BorderBrush="{x:Null}">
<ListView.Resources>
<Style TargetType="{x:Type ListViewItem}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background"
Value="{StaticResource ResourceKey= ItemSelectedColor}"/>
<Setter Property="BorderBrush"
Value="{StaticResource ResourceKey= ItemSelectedColor}"/>
</Trigger>
<Trigger Property="IsSelected" Value="true">
<Setter Property="Background"
Value="Red"/>
<Setter Property="Foreground"
Value="Red"/>
</Trigger>
</Style.Triggers> </Style>
<local:DateToMonthDayWeekConvert x:Key="dateToMonthDayWeekConvert" />
</ListView.Resources> <ListView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="18" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Converter={StaticResource dateToMonthDayWeekConvert}}" Grid.Column="1" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
上一篇:checkbox全选与反选


下一篇:Volley 图片加载相关源码解析