Locally set value takes precedence over Style value
If a DependencyProperty’s value is locally set, this value takes precedence over whatever value specified in Style. For example, the only button’s Background is LightGreen instead of LightBlue:
<Grid xmlns="http://schemas.microsoft.com/winfx/avalon/2005" >
<Grid.Resources>
<Style>
<Button Background="LightBlue"/>
</Style>
</Grid.Resources>
<Button Content="Demo" Background="LightGreen"/>
</Grid>
The first example is indeed very obvious. Now take a look at the next example, in which PropertyTrigger within Style is used. When you move mouse over the only button, what will be its Background?
<Grid xmlns="http://schemas.microsoft.com/winfx/avalon/2005" >
<Grid.Resources>
<Style>
<Button />
<Style.VisualTriggers>
<PropertyTrigger Property="IsMouseOver" Value="True">
<Set PropertyPath="Background" Value="LightBlue"/>
</PropertyTrigger>
</Style.VisualTriggers>
</Style>
</Grid.Resources>
<Button Content="Demo" Background="LightGreen"/>
</Grid>
Because locally set value takes precedence over style value, the Background remains LightGreen when IsMouseOver is true.
To see the effect of PropertyTrigger, move Background="LightGreen" into Style definition.
(This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm)