WPF 触发器绘制Datagrid自定义变色单元格
程序员文章站
2024-02-28 19:29:16
...
WPF 触发器绘制Datagrid自定义变色单元格 (资源)
<Window.Resources>
<!--<c:ErrorConverter x:Key="ErrorConverter"/>-->
<c:SheetArr x:Key="SheetCols"/>
<Style TargetType="{x:Type Button}" x:Key="highlightStyle">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" Value="#EEEEEE" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="true" />
</MultiTrigger.Conditions>
<Setter Property="BorderBrush" Value="Red"/>
<Setter Property="FontSize" Value="14" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Foreground" Value="Red" />
</MultiTrigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type DataGridRow}">
<Style.Triggers>
<DataTrigger Binding="{Binding State}" Value="格式错误">
<Setter Property="ToolTip">
<Setter.Value>
<ToolTip>
<TextBlock Text="{Binding State,StringFormat='错误:{0}'}"/>
</ToolTip>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="Red" />
</DataTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
上一篇: redmine 安装
下一篇: 安装redmine1.3.0