title: Can I change the VisualState of a DataTemplate in a ItemTemplate?
body: <p>I have some controls in a DataTemplate and I'd like to control it's pressed state behaviour. I did the following where I just put in VisualStateManager in the DataTemplate but it doesn't seem to work. I think it's possible to understand what I'm trying to do below. Is it possible to do it inline inside the DataTemplate tags?</p>
  
  <pre><code>&lt;ItemsControl ItemsSource="{Binding Items}"&gt;
      ....
      &lt;ItemsControl.ItemTemplate&gt;
          &lt;DataTemplate&gt;
            &lt;Grid ...&gt;
               &lt;VisualStateManager.VisualStateGroups&gt;
                   &lt;VisualStateGroup x:Name="CommonStates"&gt;
                       ...
                       &lt;VisualState x:Name="Pressed"&gt;
                           &lt;Storyboard&gt;
                               &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderThickness" Storyboard.TargetName="GridItemBorder"&gt;
                                   &lt;DiscreteObjectKeyFrame KeyTime="0" Value="3"/&gt;
                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                           &lt;/Storyboard&gt;
                       &lt;/VisualState&gt;
                   &lt;/VisualStateGroup&gt;
               &lt;/VisualStateManager.VisualStateGroups&gt;
               &lt;Border x:Name="Border" ...&gt;
                   ...
               &lt;/Border&gt;
            &lt;/Grid&gt;
        &lt;/DataTemplate&gt;
    &lt;/ItemsControl.ItemTemplate&gt;
  &lt;/ItemsControl&gt;
  </code></pre>