title: UWP - Use Data Template inside style in GridVIew
body: <p>An error when trying to click on the item in Grid View. I have such style setter:</p>
  
  <pre><code>&lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="GridViewItem"&gt;
                  &lt;ListViewItemPresenter x:Name="Root" ContentTemplate="{StaticResource CompletedDataTemplate}"&gt;
                      &lt;VisualStateManager.VisualStateGroups&gt;
                          &lt;VisualStateGroup x:Name="CommonStates"&gt;
                              &lt;VisualState x:Name="Pressed"&gt;                                        
                                 &lt;Storyboard&gt;
                                      &lt;DoubleAnimation Storyboard.TargetName="Item" 
                                                       Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" To="1.15" BeginTime="00:00:00.2000000"/&gt;
  
                                  &lt;DoubleAnimation Duration="00:00:00.4" Storyboard.TargetName="Item" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" To="1.15" BeginTime="00:00:00.2000000"/&gt;
                                  &lt;DoubleAnimationUsingKeyFrames EnableDependentAnimation="True" Storyboard.TargetName="grid" Storyboard.TargetProperty="(FrameworkElement.Width)"&gt;
                                          &lt;EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="471"/&gt;
                                      &lt;/DoubleAnimationUsingKeyFrames&gt;                                   
                                  &lt;/Storyboard&gt;
                              &lt;/VisualState&gt;
                          &lt;/VisualStateGroup&gt;
                          &lt;VisualStateGroup x:Name="DisabledStates"&gt;
                              &lt;VisualState x:Name="Enabled"/&gt;
                              &lt;VisualState x:Name="Disabled"/&gt;
                          &lt;/VisualStateGroup&gt;
                      &lt;/VisualStateManager.VisualStateGroups&gt;
                  &lt;/ListViewItemPresenter&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  </code></pre>
  
  <p>And also I have such Data Template:</p>
  
  <pre><code>&lt;DataTemplate x:Key="CompletedDataTemplate"&gt;
      &lt;Grid x:Name="Item" Width="471" Height="303"&gt;
  
          &lt;Grid Height="265" VerticalAlignment="Top"&gt;
              &lt;Image Stretch="Fill" Source="../Assets/Fantastic-Full-HD-Wallpaper.jpg"/&gt;
          &lt;/Grid&gt;
  
          &lt;TextBlock x:Name="textBlock" Height="20" TextAlignment="Center" Text="{Binding Name}" FontSize="21" FontFamily="../Assets/Fonts/GothamPro.ttf#Gotham Pro" Foreground="White" TextLineBounds="TrimToCapHeight"
                     VerticalAlignment="Bottom"/&gt;
  
          &lt;Grid x:Name="grid" HorizontalAlignment="Left" Height="267" VerticalAlignment="Top" Width="0" Opacity="20"&gt;
              &lt;Grid.Background&gt;
                  &lt;AcrylicBrush TintColor="Black" TintOpacity="200"/&gt;
              &lt;/Grid.Background&gt;
              &lt;TextBlock FontSize="64" Text="Open" Foreground="White" TextAlignment="Center" VerticalAlignment="Center"&gt;&lt;/TextBlock&gt;
          &lt;/Grid&gt;
      &lt;/Grid&gt;
  &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>And when I start my app, templates and binding work perfectly but I don't know how to set the target name of storyboards to my data template elements. Any idea? Maybe I should use other solution? </p>
  
  <p>Generally, I have such problem: I need to use different styles in my grid view and different Data Templates. I have already tried to use the Visual States in my data template but seems that it didn't work. </p>