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 am very glad that my suggestion was helpful for you. Please let me know if you need any further assistance on the matter.
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.
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.
Thanks!
Try to maximize window, performance issue comes again.
I have been looking into your post and I have created a sample application using the style that you have posted. The XamDataGrid in the sample application contains 10 Fields and 2000 Records and it is working as expected and does not seem to have a performance issue. I have attached the sample application that I am referring to.
Please let me know if you can reproduce this behavior using my sample application or I have missed something from your scenario.