Why does this trigger work (Changing the mouse on the "Red" button at the end of the mouse)
<Grid> <Grid.Resources> <Style TargetType="{x:Type Button}"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Foreground" Value="Red"/> </Trigger> </Style.Triggers> </Style> </Grid.Resources> <Button Content="Hello"/> </Grid>
but not this trigger, when the foreground of the button is set to color (in this case, “blue”)?
<Grid> <Grid.Resources> <Style TargetType="{x:Type Button}"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Foreground" Value="Red"/> </Trigger> </Style.Triggers> </Style> </Grid.Resources> <Button Foreground="Blue" Content="Hello"/> </Grid>
Jehof source share