Windows手机8色动画

时间:2015-10-27 10:31:10

标签: windows-phone-7 windows-phone-8 windows-phone-8.1

我想将屏幕的背景颜色从红色更改为绿色,但我也希望颜色随外观效果而变化。 我使用的代码改变了整个屏幕的颜色,但如何显示外部效果? 向外,我的意思是颜色从流动的中心到页面的末尾变化。

<StackPanel x:Name="myStackPanel" Background="Red"
  Loaded="Start_Animation">
  <StackPanel.Resources>
    <Storyboard x:Name="colorStoryboard">

      <!-- Animate the background color of the canvas from red to green
        over 4 seconds. -->
      <ColorAnimation BeginTime="00:00:00" Storyboard.TargetName="myStackPanel" 
        Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
        From="Red" To="Green" Duration="0:0:4" />

    </Storyboard>
  </StackPanel.Resources>
</StackPanel>

1 个答案:

答案 0 :(得分:0)

我认为你是在RadialGradientBrush之后(你可以叠加然后制作动画)。

已经问过:RadialGradientBrush in Windows Phone 8.1?