0
根据特定条件,我需要淡入或淡出页面顶部的项目。这些项目将包含一个图像以及可能的一些按钮。我在WP8.1中遇到了http://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.ui.xaml.media.animation.edgeuithemetransition.aspx,但是我怎样才能在WP8.0中完成这项工作呢?如何使用淡入淡出效果动画项目
根据特定条件,我需要淡入或淡出页面顶部的项目。这些项目将包含一个图像以及可能的一些按钮。我在WP8.1中遇到了http://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.ui.xaml.media.animation.edgeuithemetransition.aspx,但是我怎样才能在WP8.0中完成这项工作呢?如何使用淡入淡出效果动画项目
您应该使用Blend来创建自己的自定义动画。可以通过调整控件的不透明度来实现放入或退出。你可以按照这个link。另一个在这里link
作为一个例子,如果你想在图像上应用淡入效果这里是一个示例代码。
<phone:PhoneApplicationPage.Resources>
<Storyboard x:Name="fadeInImage">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image">
<EasingDoubleKeyFrame KeyTime="0" Value="0.1"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0.3"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0.5"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="0.7"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="0.9"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</phone:PhoneApplicationPage.Resources>
,并播放该动画调用它在必要时,
fadeInImage.Begin();