conditional colors, alternate row colors plus blinking


I have alternate row colors and conditional row colors, colors based on a numeric value in a column. 

However, now I have to add blinking to a row based on a bool value in column. 

Any hints? 



                <Style TargetType="{x:Type igWPF:DataRecordCellArea}">
                    <Setter Property="Background">
                                <SolidColorBrush Color="{Binding Path=Cells[Alarmlevel].Value, Converter={StaticResource alarmColorConverter}}">
                    <Setter Property="BackgroundAlternate">
                            <SolidColorBrush Color="{Binding Path=Cells[Alarmlevel].Value, Converter={StaticResource alarmColorLowConverter}}">
  • 27320
    Offline posted

    Hello Oskar,

    In order to animate a row in the XamDataGrid based on a bool value in another column, I would recommend continuing with the idea of a Style for DataRecordCellArea, and utilize a DataTrigger with it. For example, you could continue binding to the Cells collection, and you could also bind to the underlying DataItem property to access your underlying type.

    The DataTrigger class has EnterActions and ExitActions, and I would recommend that you utilize a BeginStoryboard element pointed at a Storyboard with a ColorAnimation pointed at <BackgroundPropertyName>.Color. This DataTrigger could look like the following:

    <DataTrigger Binding="{Binding DataItem.Animate}" Value="True">
      <BeginStoryboard Storyboard="{StaticResource animateStory}" Name="beginStory"/>
      <StopStoryboard BeginStoryboardName="beginStory" />

    In this case, the "animateStory" Storyboard could look like the following:

    <Storyboard x:Key="animateStory">
      <ColorAnimation Duration="0:0:1" To="Red" RepeatBehavior="Forever" AutoReverse="True" Storyboard.TargetProperty="Background.Color"/>

    I have attached a sample project to demonstrate the above. I hope this helps.

    Please let me know if you have any other questions or concerns on this matter.

    Associate Developer

Reply Children
No Data