2014-09-21 82 views

回答

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();