Hi I have a situation where I need to check a property "HasDelivered" if true. the foreground color of my textBlock should be green else red.
Any ideas or suggestions
Hi I have a situation where I need to check a property "HasDelivered" if true. the foreground color of my textBlock should be green else red.
Any ideas or suggestions
Use a style with a data trigger:
<TextBlock ...>
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Red" />
<Style.Triggers>
<DataTrigger Binding="{Binding HasDelivered}" Value="True">
<Setter Property="Foreground" Value="Green" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>