I have the following haml:
<DockPanel> <DockPanel.Resources> <Style TargetType="Button"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Foreground" Value="Yellow"></Setter> </Trigger> <Trigger Property="IsPressed" Value="True"> <Setter Property="Foreground" Value="Green"></Setter> </Trigger> </Style.Triggers> </Style> </DockPanel.Resources> <Button Content="Cut" Height="30" Width="75"/> </DockPanel>
What happens when I press a button, the foreground changes to yellow, and then when I press a button, the foreground changes to green.
Now, if I reverse the order of my triggers in XAML, the foreground changes to yellow when I click on it, but when I click on the button, the foreground does not change to green.
What is the explanation for this? Is one trigger a priority for another?
triggers wpf
ScottG Feb 18 '09 at 14:09 2009-02-18 14:09
source share