これが私のXAMLコードです。
<Grid>
<Grid.Resources>
<Storyboard x:Name="myStoryboard">
<DoubleAnimation x:Name="myDoubleAnimation" Storyboard.TargetProperty="Opacity" From="1.0" To="0.0" Duration="0:0:0.2" AutoReverse="True"/>
</Storyboard>
</Grid.Resources>
<Grid x:Name="op_food" PointerEntered="op_PointerEntered">
<TextBlock Text="Food"/>
</Grid>
<Grid x:Name="op_cineplex" PointerEntered="op_PointerEntered">
<TextBlock Text="Cineplex"/>
</Grid>
</Grid>
そしてC#関数、
private void op_PointerEntered(object sender, PointerRoutedEventArgs e)
{
myStoryboard.Stop();
Grid myGrid = (Grid)sender;
myDoubleAnimation.SetValue(Storyboard.TargetProperty,myGrid.Name);
myStoryboard.Begin();
}
これは、このタスクを実行するためにたどったリンクであり、インテリセンスはストーリーボードを見つけることができませんでした-> http://blogs.msdn.com/b/silverlight_sdk/archive/2008/03/26/target-multiple-objects-properties -with-one-animation-silverlight.aspx
だから私はこのコードのどこが間違っているのですか?