• 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>
    至少证明我们还活着
  • 相关阅读:
    Picture
    wolf and rabbit
    十进制转换为二进制(一直不会算的)
    各种排序
    折线分割平面
    字母数
    1001
    Primes
    大数的减法神秘数
    转: Windows Internet WinINet 学习笔记(2)
  • 原文地址:https://www.cnblogs.com/pengde/p/5865527.html
Copyright © 2020-2023  润新知