Hi! I'm trying to animate with blinking incoming datarecord (from background thread).
I'm extending DataRecordCellArea style in my control:
<Style x:Key="aniDataRecordPresenter" TargetType="{x:Type igDP:DataRecordCellArea}" BasedOn="{StaticResource {x:Type igDP:DataRecordCellArea}}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=Record.Tag, RelativeSource={RelativeSource Self}}" Value="true"> <DataTrigger.EnterActions> <BeginStoryboard Name="BackgroundColorStoryboard"> <Storyboard> <ColorAnimation DesiredFrameRate="5" Storyboard.TargetProperty="Background.Color" From="Black" To="Red" FillBehavior="Stop" RepeatBehavior="Forever" /> </Storyboard> </BeginStoryboard> <BeginStoryboard Name="BackgroundAlternateColorStoryboard"> <Storyboard> <ColorAnimation DesiredFrameRate="5" Storyboard.TargetProperty="BackgroundAlternate.Color" From="Black" To="Red" FillBehavior="Stop" RepeatBehavior="Forever" /> </Storyboard> </BeginStoryboard> </DataTrigger.EnterActions> </DataTrigger> <DataTrigger Binding="{Binding Path=Record.Tag, RelativeSource={RelativeSource Self}}" Value="false"> <DataTrigger.EnterActions> <StopStoryboard BeginStoryboardName="BackgroundColorStoryboard" /> <StopStoryboard BeginStoryboardName="BackgroundAlternateColorStoryboard" /> </DataTrigger.EnterActions> </DataTrigger> </Style.Triggers> </Style> * This source code was highlighted with Source Code Highlighter .
Record.Tag receives true when record is added to the Item source of xamDataPresenter, and switches to false on RecordSeceltion event.
But when a wide range of records are blinking, application have performance issues.
May be there is another approach of record animation? Or any ways to improve animation performance ?
P.S.
I'm setting DataRecordCellAreaStyle in my FieldLayoutSettings
Hello,
I have further investigate the behavior that you are describing and the sample application that I have created does not seem to have any issues even the application runs in full screen. I am attaching a video of the behavior that I am getting with the sample application that I have previously attached. I have changed the animation color, so the video will be more clear.
If you wish to improve the performance of the XamDataGrid I can suggest looking into the following blog post by Kiril Matev, which describes how you can achieve better performance of the XamDataGrid: http://blogs.infragistics.com/blogs/kiril_matev/archive/2010/10/26/optimizing-xamdatagrid-performance.aspx
If you need any further assistance please do not hesitate to ask.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Thanks a lot.
I've already solved this problem by changing Background and BackgroundAlternate properties of DataRecordCellAreaPresenter to appropriate color brush.
This approach gives better perfomance than using Animation.