I am trying to add a Mouse Over effect to my Windows 8 application. Specifically I'm trying to add it to DataTemplates bound to a GridView. However, Currently, nothing is happening, I've tried to follow the Microsoft tutorials but most of those are either out of date or for different versions of XAML.
My code looks like this:
<DataTemplate x:Key="GameTileTemplate">
<Grid x:Name="grid" Width="173" Height="173" RenderTransformOrigin="0.5,0.5" >
<Grid.Clip>
<RectangleGeometry Rect="0,0,173,173"/>
</Grid.Clip>
<Image Grid.RowSpan="3" Stretch="UniformToFill"/>
<Grid x:Name="DataPanel" Margin="-173,0,0,0" Grid.RowSpan="3" RenderTransformOrigin="0.5,0.5" Width="346" HorizontalAlignment="Left" VerticalAlignment="Top" Height="173">
<!--There is more here-->
</Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStateGroup">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerEntered">
<Storyboard>
<DoubleAnimation From="1" To="0" Duration="00:00:02"
Storyboard.TargetName="DataPanel"
Storyboard.TargetProperty="Opacity">
</DoubleAnimation>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</DataTemplate>
The Opacity of my DataPanel does not change. Do I need some other code somewhere? The Microsoft Tutorial was for a ControlTemplate, is this causing the error since my Template is a DataTemplate?