Vit*_*kin 1 .net silverlight events triggers windows-phone-7
我的Windows Phone 7 Silverlight应用程序中有一些触发器,例如
<Grid x:Name="ContentGrid" Grid.Row="1" Background="Red" Height="100">
<Grid.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="Opacity">
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
<SplineDoubleKeyFrame KeyTime="00:00:10" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Grid.Triggers>
</Grid>
Run Code Online (Sandbox Code Playgroud)
但是当Loaded事件触发时,会发生XamlParseException.我用谷歌搜索了一下,但一无所获.
有什么想法找到解决方案?谢谢.
我改变了你的代码:
查看以下代码:
<Grid x:Name="ContentGrid" Grid.Row="1" Background="Red" Height="100">
<Grid.Triggers>
<EventTrigger RoutedEvent="Grid.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ContentGrid" Storyboard.TargetProperty="Grid.Opacity">
<SplineDoubleKeyFrame KeyTim>
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
<SplineDoubleKeyFrame KeyTime="00:00:10" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Grid.Triggers>
</Grid>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1273 次 |
最近记录: |