I have a requirement where I want to highlight a for x seconds when the object bound to a row is in certain state.I am using a datatrigger together with a coloranimation for this purpose. When the condition is met, I trigger the storyboard action. Below is the xaml. The problem I am facing is when I scroll the animation seems to be carrying to other rows which do not satisfy the condition. I have enabled row virtualization. This seems something to do with recycling the row containers ? Any help is greatly appreciated.
<Style x:Key="test" TargetType="{x:Type telerikGridView:GridViewRow}">
<Setter Property="Background" Value="White"/>
<Style.Triggers>
<DataTrigger Value="true">
<DataTrigger.Binding>
<MultiBinding Mode="OneWay" Converter="{StaticResource backgroundConverter}">
<Binding Path="FirstName"/>
<Binding Path="LastName"/>
</MultiBinding>
</DataTrigger.Binding>
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ColorAnimationUsingKeyFrames
AutoReverse="True" BeginTime="00:00:00"
Duration="00:00:5"
Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Color)">
<LinearColorKeyFrame Value="Green" KeyTime="00:00:.5" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
</Style.Triggers>
</Style>