I have a listview defined as such
<ListView Width="auto"
SelectionMode="Single"
ItemContainerStyle="{StaticResource ItemContStyle}"
....
Then in "baseListViewStyle" I have defined some base styles to apply to my list views, including a Style trigger:
<Style x:Key="baseListViewStyle" TargetType="ListViewItem">
<Setter Property="Height" Value="20" />
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="Red" />
</Trigger>
</Style.Triggers>
</Style>
The trigger here highlights the row when mouse is over it. Nice.
I also have a Data Trigger on the listviewitem:
<Style.Triggers>
<DataTrigger Binding="{Binding IsTestTrue}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource SomeFunkyAnimation}" />
</DataTrigger.EnterActions>
</DataTrigger>
If test is true then a nice little fade animation is played out. This all works except when I move my mouse over the row where "test is true" the animation stops and the mouse over style is displayed.
Any ideas how I can override that style in my DataTrigger?
TIA
Update
"SomeFunkyAnimation" animates the background colour. The xaml for it is here:
<Style x:Key="ItemContStyle" TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource baseListViewStyle}">
<Style.Resources>
<Storyboard x:Key="SomeFunkyAnimation" FillBehavior="Stop">
<ColorAnimation Storyboard.TargetProperty="Background.Color" RepeatBehavior="Forever" From="Red" To="Pink" Duration="0:0:3"/>
</Storyboard>
</Style.Resources>
The "MouseOver" trigger is defined in "baseListViewStyle". The DataTrigger is defined in "ItemContStyle".
I tried removing the "MouseOver"Style trigger but that didn't work as I believe the Listview has a default "MouseOver" Style already defined so it overrides my DataTrigger animation.