Version

About Repositioning Animations

The xamDataCards™ control animates cards into position when it rearranges its cards. This can happen when your end users interact with xamDataCards by scrolling, collapsing, resizing cards, or when you reset the data source. However, you can disable the animation or customize the animation’s timing by setting the CardViewSettings object’s ShouldAnimateCardPositioning property or RepositionAnimation property, respectively.

If you want to customize the animation’s timing, you can set the CardViewSettings object’s RepositionAnimation property to an instance of an object that derives from the DoubleAnimationBase class, e.g., a DoubleAnimation object. However, if you disable animations, the xamDataCards control will ignore the custom animation timing you provide. For more information, see the Remarks section for the RepositionAnimation property in the API Reference Guide.

The following example code demonstrates how to modify the animation timings.

In XAML:

<Window.Resources>
    <DoubleAnimationUsingKeyFrames x:Key="repositionAnimation1">
        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
        <SplineDoubleKeyFrame KeyTime="00:00:01" Value="1.5" />
        <SplineDoubleKeyFrame KeyTime="00:00:01.5" Value="0.8" />
        <SplineDoubleKeyFrame KeyTime="00:00:02" Value="1" />
    </DoubleAnimationUsingKeyFrames>
</Window.Resources>
...
<igDP:XamDataCards Name="xamDataCards1">
    <igDP:XamDataCards.ViewSettings>
        <igDP:CardViewSettings RepositionAnimation="{StaticResource repositionAnimation1}" />
    </igDP:XamDataCards.ViewSettings>
</igDP:XamDataCards>
...

In Visual Basic:

Me.xamDataCards1.ViewSettings.RepositionAnimation = TryCast(Me.Resources("repositionAnimation1"), DoubleAnimationBase)

In C#:

this.xamDataCards1.ViewSettings.RepositionAnimation = this.Resources["repositionAnimation1"] as DoubleAnimationBase;