There are three types of trigger in WPF named Property Trigger, Data Trigger and Event trigger. All of the triggers are inherited by TriggerBase class. Here is a partial class diagram of TriggerBase class.
With the help of trigger, we can set the property changes declaratively when other property changes, data changes or event happened.
Property trigger is probably the most commonly used trigger. It monitor the value of the specified property. Data trigger is quite similar to property trigger and execute when property has some specified value. Event trigger is different then both property and data trigger. Instead of monitoring the value of the property, this trigger execute when some specified event is raised. One typical example of event trigger is animation. If we want to perform some animation at the time of loading the application, then we start that animation with event trigger and select load as an event trigger.
Here is a simple example of Property Trigger.
1: <Window x:Class="TypeConvertor.Window1"2: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"3: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"4: Title="Property Trigger Demo" Height="300" Width="400">5: <Window.Resources>6: <Style TargetType="{x:Type TabItem}">7: <Style.Triggers>8: <Trigger Property="IsFocused" Value="True">9: <Setter Property="FontWeight" Value="Bold"/>10: <Setter Property="Foreground" Value="Blue"/>11: </Trigger>12: </Style.Triggers>13: </Style>14: </Window.Resources>15:16: <Grid>17: <TabControl>18: <TabItem Header="Visual C++"></TabItem>19: <TabItem Header="Visual C#"></TabItem>20: <TabItem Header="Visual Basic"></TabItem>21: <TabItem Header="F#"></TabItem>22: </TabControl>23: </Grid>24: </Window>25:Here we are going to define property trigger on tab item. We select two properties when tab item has focus i.e. change the font color and make the font bold. Here is the output of this program when we select second tab.


[...] animation with Property Trigger We have already saw an example of Property Trigger and animation using XAML. Now we are going to use these two concepts together and apply animation [...]
By: Apply animation with Property Trigger « Zeeshan Amjad's WPF Blog on February 5, 2010
at 11:42 pm
These are the most common and basic types of triggers within the WPF programmatic model. They are
basically XAML condition statements that check the state of a property to determine whether to use a
specific style/setter value within the style of the element.
http://www.mindstick.com/Blog/168/Property%20Triggers%20in%20WPF
By: Pankaj Singh on November 15, 2011
at 10:44 am
Very good explaintation.
I beleive
shoudl be
By: erwer on July 10, 2012
at 11:30 am
Thanks to visit my blog and like it.
Regards
Zeeshan Amjad
By: Zeeshan Amjad on July 11, 2012
at 10:26 am
I beleive
instead of IsFocused it should be IsSelected
By: erwer on July 10, 2012
at 11:31 am
Thanks for pointing out the mistake. Yes in this case IsSelected is more appropriate.
Regards
Zeeshan Amjad
By: Zeeshan Amjad on July 11, 2012
at 10:26 am