<syncfusion:SfAccordion.HeaderTemplate>
<DataTemplate>
<Grid>
<Grid.Resources>
<Style TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSourceMode=FindAncestor, AncestorType={x:Type syncfusion:SfAccordionItem}}}"Value="True">
<Setter Property="Foreground" Value="Red" />
</DataTrigger>
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSourceMode=FindAncestor, AncestorType={x:Type syncfusion:SfAccordionItem}}}"Value="False">
<Setter Property="Foreground" Value="Green" />
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Resources>
<TextBlock Text="{Binding}" Margin="10" FontSize="18"/>
</Grid>
</DataTemplate>
</syncfusion:SfAccordion.HeaderTemplate>
|
<VisualState x:Name="Collapsed">
<Storyboard>
<DoubleAnimation BeginTime="00:00:00" Duration="00:00:15" Storyboard.TargetName="icon" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" To="0"/>
<ColorAnimation Storyboard.TargetProperty="Fill.Color" Storyboard.TargetName="arrow" To="{Binding Source={StaticResource CollapsedStroke},Path=Color}">
</ColorAnimation>
<ColorAnimation Storyboard.TargetProperty="(ContentControl.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="header" To="Green">
</ColorAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="Expanded">
<Storyboard>
<DoubleAnimation BeginTime="00:00:00" Duration="00:00:15" Storyboard.TargetName="icon" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" To="90"/>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:5" Storyboard.TargetName="ExpandedBackground" Storyboard.TargetProperty="(UIElement.Opacity)">
<EasingDoubleKeyFrame KeyTime="00:00:01" Value="0.1"/>
<EasingDoubleKeyFrame KeyTime="00:00:02" Value="0.4"/>
<EasingDoubleKeyFrame KeyTime="00:00:03" Value="0.6"/>
<EasingDoubleKeyFrame KeyTime="00:00:04" Value="0.8"/>
<EasingDoubleKeyFrame KeyTime="00:00:015" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<ColorAnimation Storyboard.TargetProperty="Fill.Color" Storyboard.TargetName="arrow" To="{Binding Source={StaticResource ExpandedStroke},Path=Color}">
</ColorAnimation>
<ColorAnimation Storyboard.TargetProperty="(ContentControl.Foreground).(SolidColorBrush.Color)" Duration="0:0:1" Storyboard.TargetName="header" To="Red">
</ColorAnimation>
</Storyboard>
</VisualState> |