DataTrigger

 <ListView Name="lvStatus" MinHeight="120" Grid.Row="2">

            <ListView.Resources>
<Style TargetType="ListViewItem">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Staff}" Value="Total">
<Setter Property="FontSize" Value="14" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Background" Value="AliceBlue" />
</DataTrigger>
</Style.Triggers>
</Style>
</ListView.Resources>
<ListView.View>
<GridView>
<GridView.Columns>
<GridViewColumn Header="Staff" Width="150" DisplayMemberBinding="{Binding Staff}">
上一篇:正经学C#_判断[switch语句]:[c#入门经典]


下一篇:读取Excel文件存储在实体类中