Created
June 25, 2014 06:42
-
-
Save yukitos/7e417f082b083c0fea72 to your computer and use it in GitHub Desktop.
Set GridViewColumn's text color red if binding 'Result' property equals 'Error'.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- (snip) --> | |
<GridViewColumn Header="Result" DisplayMemberBinding="{Binding Result}"> | |
<GridViewColumn.CellTemplate> | |
<DataTemplate> | |
<TextBlock Text="{Binding}"> | |
<TextBlock.Style> | |
<Style TargetType="{x:Type TextBlock}"> | |
<Style.Triggers> | |
<MultiDataTrigger> | |
<MultiDataTrigger.Conditions> | |
<Condition Binding="{Binding}" Value="Error"/> | |
</MultiDataTrigger.Conditions> | |
<Setter Property="Foreground" Value="Red"/> | |
</MultiDataTrigger> | |
</Style.Triggers> | |
</Style> | |
</TextBlock.Style> | |
</TextBlock> | |
</DataTemplate> | |
</GridViewColumn.CellTemplate> | |
</GridViewColumn> | |
<!-- (snip) --> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment