We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

accordion animation

Hello,

I would like to know if there is a way to prevent the accordion transition having animation when an item is selected.
I have to load an accordion in page with a item already open. But the the selecion changing happend after dispaying the accordion. I would like to avoid to see the transition animation.

regards,

Thibault

1 Reply

VR Vijayalakshmi Roopkumar Syncfusion Team February 1, 2017 03:22 PM UTC

Hi Thibault,

Thank you for using Syncfusion products.

We have prepared a sample that tries to meet your requirement. In our sample, we have edited the template of SfAccordionItem style to disable the transition animation on selecting the item and apply the style using the ItemcontainerStyle property of SfAccordion. Please find the code snippet for the same. 
Code Snippet:[XAML] 
 
<!--Code used to disable the animation--> 
<VisualState x:Name="Collapsed"> 
<Storyboard> 
<DoubleAnimationUsingKeyFrames 
BeginTime="00:00:00" Duration="00:00:01" EnableDependentAnimation="True" 
Storyboard.TargetName="ExpandSite" 
Storyboard.TargetProperty="(ExpandableContentControl.Percentage)"> 
<SplineDoubleKeyFrame KeySpline="0.2,0,0,1" KeyTime="00:00:0.0" Value="0" /> 
</DoubleAnimationUsingKeyFrames> 
</Storyboard> 
 
</VisualState> 
<VisualState x:Name="Expanded"> 
<Storyboard> 
<DoubleAnimationUsingKeyFrames 
BeginTime="00:00:00" Duration="00:00:01" EnableDependentAnimation="True" 
Storyboard.TargetName="ExpandSite" 
Storyboard.TargetProperty="(ExpandableContentControl.Percentage)"> 
<SplineDoubleKeyFrame KeySpline="0.2,0,0,1" KeyTime="00:00:0.0" Value="1" /> 
</DoubleAnimationUsingKeyFrames> 
</Storyboard> 
</VisualState> 
</VisualStateGroup> 
 
CodeSnippet:[XAML] 
 
 
   <!--Code shows how to set the ItemContainerStyle for SfAccordion--> 
<navigation:SfAccordion x:Name="accordion"  HorizontalAlignment="Center" VerticalAlignment="Center" Width="300" ItemContainerStyle="{StaticResource Style1}"> 
 
  
Regards, 
Vijayalakshmi V.R. 


Loader.
Up arrow icon