|
<VisualState x:Name="Expanded">
<Storyboard>
<DoubleAnimation
BeginTime="00:00:00"
Storyboard.TargetName="icon"
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"
To="90"
Duration="00:00:00.3" />
<DoubleAnimationUsingKeyFrames
BeginTime="00:00:00"
Storyboard.TargetName="ExpandedBackground"
Storyboard.TargetProperty="(UIElement.Opacity)"
Duration="00:00:00.0010000">
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
</DoubleAnimationUsingKeyFrames>
<ColorAnimation
Storyboard.TargetName="arrow"
Storyboard.TargetProperty="Fill.Color"
To="{Binding Source={StaticResource ExpandedStroke}, Path=Color}" />
<ColorAnimation
Storyboard.TargetName="header"
Storyboard.TargetProperty="(ContentControl.Foreground).(SolidColorBrush.Color)"
To="Red" />
</Storyboard>
</VisualState>
|
|
<Window.Resources>
<DataTemplate x:Key="CustomHeaderTemplate">
<Grid>
<Grid.Resources>
<Style TargetType="TextBlock">
<Style.Triggers>
<!--Change the forecolor on expand state-->
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type syncfusion:SfAccordionItem}}}" Value="True">
<Setter Property="Foreground" Value="Red" />
</DataTrigger>
<!--Change the forecolor on collapsed state-->
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type syncfusion:SfAccordionItem}}}" Value="False">
<Setter Property="Foreground" Value="Green" />
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Resources>
<TextBlock Text="{Binding}"/>
</Grid>
</DataTemplate>
</Window.Resources>
<!--Apply the headertemplate-->
<syncfusion:SfAccordion
Width="400"
Height="300"
HorizontalAlignment="Center"
VerticalAlignment="Center"
HeaderTemplate="{StaticResource CustomHeaderTemplate}">
|