title: How to animate ContentPresenter Panel.ZIndex property?
body: <p>I have <code>&lt;ItemsControl&gt;</code> which create view for my <code>&lt;custom:Pack&gt;</code> list:</p>
  
  <pre><code>&lt;ItemsControl ItemsSource="{Binding List}"&gt;
      &lt;ItemsControl.ItemsPanel&gt;
          &lt;ItemsPanelTemplate&gt;
              &lt;local:ShelfPanel /&gt;
          &lt;/ItemsPanelTemplate&gt;
      &lt;/ItemsControl.ItemsPanel&gt;
      &lt;ItemsControl.ItemContainerStyle&gt;
          &lt;Style&gt;
              &lt;Setter Property="local:ShelfPanel.Exact" Value="{Binding Exact}"/&gt;
              // Default ZIndex is set 1, when Active it should be higher, hence will be over others.
              &lt;Setter Property="Panel.ZIndex" Value="1" /&gt;
          &lt;/Style&gt;
      &lt;/ItemsControl.ItemContainerStyle&gt;
      &lt;ItemsControl.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;custom:Pack Background="Red" Width="150" Height="150" &gt;
                  &lt;VisualStateManager.VisualStateGroups&gt;
                      &lt;VisualStateGroup x:Name="MyStates"&gt;
                          &lt;VisualState x:Name="Normal" /&gt;
                          &lt;VisualState x:Name="Selected"&gt;
                              &lt;Storyboard&gt;
                                  &lt;ColorAnimation Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Color)" To="Yellow" Duration="0:0:0.5" /&gt;
                              &lt;/Storyboard&gt;
                          &lt;/VisualState&gt;
                          &lt;VisualState x:Name="Active"&gt;
                              &lt;Storyboard&gt;
                                  &lt;ColorAnimation Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Color)" To="Green" Duration="0:0:0.5" /&gt;
                                  // How to animate ZIndex on ContentPresenter ?
                                  &lt;Int32Animation Storyboard.TargetProperty="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ContentPresenter}}, Path=(Panel.ZIndex)}" To="3" Duration="00:00:0.2"/&gt;
                              &lt;/Storyboard&gt;
                          &lt;/VisualState&gt;
                      &lt;/VisualStateGroup&gt;
                  &lt;/VisualStateManager.VisualStateGroups&gt;
              &lt;/custom:Pack&gt;
          &lt;/DataTemplate&gt;
      &lt;/ItemsControl.ItemTemplate&gt;
  &lt;/ItemsControl&gt;
  </code></pre>
  
  <p>The <code>&lt;local:ShelfPanel&gt;</code> is designed that way <code>&lt;custom:Pack&gt;</code> is overlapping each other. Now when you select one <code>&lt;custom:Pack&gt;</code> it's state change to <code>Active</code> and object should be over all others.
  Currenty I get expection: </p>
  
  <blockquote>
    <p>You must specify TargetProperty for "System.Windows.Media.Animation.Int32 Animation</p>
  </blockquote>
  
  <p>To achive this I need set ZInedx on ContentPresenter, how to do it?</p>