<Style TargetType="toolkit:ExpanderView" x:Key="ExpanderViewStyle1">
  <Style.Setters>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="ItemsPanel">
      <Setter.Value>
        <ItemsPanelTemplate>
          <StackPanel/>
        </ItemsPanelTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="toolkit:ExpanderView">
          <Grid>
            <Grid.Resources>
              <QuadraticEase EasingMode="EaseOut" x:Key="QuadraticEaseOut"/>
              <QuadraticEase EasingMode="EaseInOut" x:Key="QuadraticEaseInOut"/>
            </Grid.Resources>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto"/>
              <RowDefinition Height="Auto"/>
              <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="ExpansionStates">
                <VisualStateGroup.States>
                  <VisualState x:Name="Collapsed">
                    <Storyboard>
                      <DoubleAnimation Storyboard.TargetProperty="(FrameworkElement.Height)" 
                                Storyboard.TargetName="ItemsCanvas" Duration="0" To="0"/>
                      <DoubleAnimation Storyboard.TargetProperty="(UIElement.Opacity)" 
                                Storyboard.TargetName="ItemsCanvas" Duration="0" To="0.0"/>
                    </Storyboard>
                  </VisualState>
                  <VisualState x:Name="Expanded">
                    <Storyboard>
                      <DoubleAnimation Storyboard.TargetProperty="(FrameworkElement.Height)" 
                                Storyboard.TargetName="ItemsCanvas" Duration="0"/>
                      <DoubleAnimation Storyboard.TargetProperty="(UIElement.Opacity)" 
                                Storyboard.TargetName="ItemsCanvas" Duration="0" To="1.0"/>
                    </Storyboard>
                  </VisualState>
                </VisualStateGroup.States>
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Collapsed" To="Expanded" GeneratedDuration="0:0:0.15">
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="ItemsCanvas">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.00" Value="0" EasingFunction="{StaticResource QuadraticEaseOut}"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.15" Value="1" EasingFunction="{StaticResource QuadraticEaseOut}" x:Name="CollapsedToExpandedKeyFrame"/>
                      </DoubleAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ItemsCanvas" Duration="0" To="1.0"/>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="Expanded" To="Collapsed" GeneratedDuration="0:0:0.15" >
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="ItemsCanvas">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.00" Value="1" EasingFunction="{StaticResource QuadraticEaseInOut}" x:Name="ExpandedToCollapsedKeyFrame"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.15" Value="0" EasingFunction="{StaticResource QuadraticEaseInOut}"/>
                      </DoubleAnimationUsingKeyFrames>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ItemsCanvas">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.00" Value="1.0" EasingFunction="{StaticResource QuadraticEaseInOut}"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.15" Value="0.0" EasingFunction="{StaticResource QuadraticEaseInOut}"/>
                      </DoubleAnimationUsingKeyFrames>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"
                                      Storyboard.TargetName="ItemsCanvas">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.00" Value="0.0" EasingFunction="{StaticResource QuadraticEaseInOut}"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.15" Value="-35" EasingFunction="{StaticResource QuadraticEaseInOut}"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ExpandabilityStates">
                <VisualState x:Name="Expandable"/>
                <VisualState x:Name="NonExpandable">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ExpandableContent">
                      <DiscreteObjectKeyFrame KeyTime="0:0:0.0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Line">
                      <DiscreteObjectKeyFrame KeyTime="0:0:0.0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="NonExpandableContent">
                      <DiscreteObjectKeyFrame KeyTime="0:0:0.0" Value="Visible"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <ListBoxItem x:Name="ExpandableContent" toolkit:TiltEffect.IsTiltEnabled="True" 
             HorizontalContentAlignment="Stretch"
             Grid.Row="0" Grid.RowSpan="2" FontFamily="Portable User Interface">
              <Grid>
                <Grid.RowDefinitions>
                  <RowDefinition Height="Auto"/>
                  <RowDefinition Height="Auto"/>
                  <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <ContentControl x:Name="Header"
                                HorizontalContentAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Content="{TemplateBinding Header}"
                                ContentTemplate="{TemplateBinding HeaderTemplate}" />
                <ContentControl x:Name="Expander"            
                                Margin="0"
                                Grid.Row="1"
                                HorizontalContentAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Content="{TemplateBinding Expander}"
                                ContentTemplate="{TemplateBinding ExpanderTemplate}"/>
                <Grid x:Name="ExpanderPanel" Grid.Row="0" Grid.RowSpan="2" Background="Transparent"/>
              </Grid>
            </ListBoxItem>
            <ContentControl x:Name="NonExpandableContent"
                            Grid.Row="0" 
                            Grid.RowSpan="2" 
                            Visibility="Collapsed"
                            HorizontalAlignment="Stretch"
                            HorizontalContentAlignment="Stretch"
                            Content="{TemplateBinding NonExpandableHeader}"
                            ContentTemplate="{TemplateBinding NonExpandableHeaderTemplate}" FontFamily="Portable User Interface"/>
            <Canvas x:Name="ItemsCanvas" 
                    Grid.Row="2"
                    Opacity="0.0" 
                    Margin="0">
              <ItemsPresenter x:Name="Presenter"/>
              <Canvas.RenderTransform>
                <CompositeTransform TranslateY="0.0"/>
              </Canvas.RenderTransform>
            </Canvas>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style.Setters>
</Style>