wpf Trigger


The simplest of the five trigger types, the Trigger is responsible for setting properties based on other properties within the same control.

        <Style TargetType="{x:Type TextBlock}">
                <Trigger Property="Text" Value="Pass">
                    <Setter Property="Foreground" Value="Green"/>

In this example, the foreground color of the TextBlock will turn green when it's Text property is equal to the string "Pass".