<phone:PhoneApplicationPage.Resources>
<Style x:Key="ButtonStyle1" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
<Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMedium}"/>
<Setter Property="Padding" Value="10,5,10,6"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="grid">
<Grid.Resources>
<Storyboard x:Name="Storyboard1">
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="grid">
<EasingColorKeyFrame KeyTime="0" Value="#FFECB010"/>
<EasingColorKeyFrame KeyTime="0:0:1" Value="#FF4CEC10"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimation Duration="0" To="#FFECB010" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)" Storyboard.TargetName="grid">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.884"/>
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.715"/>
<EasingDoubleKeyFrame KeyTime="0:0:3" Value="0.502"/>
<EasingDoubleKeyFrame KeyTime="0:0:4" Value="0.15"/>
<EasingDoubleKeyFrame KeyTime="0:0:5" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Offset)" Storyboard.TargetName="grid">
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.94"/>
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.751"/>
<EasingDoubleKeyFrame KeyTime="0:0:3" Value="0.518"/>
<EasingDoubleKeyFrame KeyTime="0:0:4" Value="0.2"/>
<EasingDoubleKeyFrame KeyTime="0:0:5" Value="0.008"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[3].(GradientStop.Offset)" Storyboard.TargetName="grid">
<EasingDoubleKeyFrame KeyTime="0" Value="0.787"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.888"/>
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.719"/>
<EasingDoubleKeyFrame KeyTime="0:0:3" Value="0.498"/>
<EasingDoubleKeyFrame KeyTime="0:0:4" Value="0.15"/>
<EasingDoubleKeyFrame KeyTime="0:0:5" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[2].(GradientStop.Offset)" Storyboard.TargetName="grid">
<EasingDoubleKeyFrame KeyTime="0" Value="0.787"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.888"/>
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.715"/>
<EasingDoubleKeyFrame KeyTime="0:0:3" Value="0.494"/>
<EasingDoubleKeyFrame KeyTime="0:0:4" Value="0.15"/>
<EasingDoubleKeyFrame KeyTime="0:0:5" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[4].(GradientStop.Offset)" Storyboard.TargetName="grid">
<EasingDoubleKeyFrame KeyTime="0:0:3" Value="0.309"/>
<EasingDoubleKeyFrame KeyTime="0:0:4" Value="0.15"/>
<EasingDoubleKeyFrame KeyTime="0:0:5" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.Foreground).(GradientBrush.GradientStops)[0].(GradientStop.Offset)" Storyboard.TargetName="ContentContainer">
<EasingDoubleKeyFrame KeyTime="0" Value="0.9"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.7"/>
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.65"/>
<EasingDoubleKeyFrame KeyTime="0:0:3" Value="0.438"/>
<EasingDoubleKeyFrame KeyTime="0:0:4" Value="0.25"/>
<EasingDoubleKeyFrame KeyTime="0:0:5" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.Foreground).(GradientBrush.GradientStops)[1].(GradientStop.Offset)" Storyboard.TargetName="ContentContainer">
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.75"/>
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.731"/>
<EasingDoubleKeyFrame KeyTime="0:0:3" Value="0.5"/>
<EasingDoubleKeyFrame KeyTime="0:0:4" Value="0.458"/>
<EasingDoubleKeyFrame KeyTime="0:0:5" Value="0.06"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</Grid.Resources>
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="White" Offset="1"/>
<GradientStop Color="#FFECB010" Offset="0.787"/>
<GradientStop Color="#FFECB010" Offset="0.787"/>
<GradientStop Color="#FFECB010" Offset="0.309"/>
</LinearGradientBrush>
</Grid.Background>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver"/>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneAccentBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" Margin="{StaticResource PhoneTouchTargetOverhang}">
<ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
<ContentControl.Foreground>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="White" Offset="1"/>
</LinearGradientBrush>
</ContentControl.Foreground>
</ContentControl>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</phone:PhoneApplicationPage.Resources>

<Button Content="Button" HorizontalAlignment="Left" VerticalAlignment="Top" Height="157" Width="279" Style="{StaticResource ButtonStyle1}"/>

wp8 入门到精通 Animation 背景加字体颜色从下向上变化颜色效果的更多相关文章

  1. wp8 入门到精通 ImageCompress 图片压缩

    //实例化选择器 PhotoChooserTask photoChooserTask = new PhotoChooserTask(); BitmapImage bimg; int newPixelW ...

  2. wp8 入门到精通 虚拟标示符 设备ID

    //获得设备虚拟标示符 wp8 public string GetWindowsLiveAnonymousID() { object anid = new object(); string anony ...

  3. wp8 入门到精通 ---时间

    DateTime.Now.ToShortTimeString()DateTime dt = DateTime.Now;dt.ToString();//2005-11-5 13:21:25dt.ToFi ...

  4. wp8 入门到精通 动画

    http://samples.msdn.microsoft.com/Silverlight/SampleBrowser/index.htm#/?sref=transforms_ovw_animatin ...

  5. wp8 入门到精通

    <StackPanel Orientation="Vertical"> <StackPanel Orientation="Horizontal" ...

  6. wp8 入门到精通 仿美拍评论黑白列表思路

    static bool isbool = false; private void BindGameDelete() { Tile tile = new Tile(); List<Color> ...

  7. wp8 入门到精通 生命周期

  8. wp8 入门到精通 定时更新瓷贴

    public class ScheduledAgent : ScheduledTaskAgent { static ScheduledAgent() { Deployment.Current.Disp ...

  9. wp8 入门到精通 Gallery

    <Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.Resources> ...

随机推荐

  1. django 添加动态表格的方法

    传统方法(基于方法的视图):http://stellarchariot.com/blog/2011/02/dynamically-add-form-to-formset-using-javascrip ...

  2. ASC47B borderless

    题目描述 border集合为{NULL,str}的串str称为borderless串. border即KMP里的那个. 字符集{'a','b'},给定长度n,求第k(给定)小的borderless串. ...

  3. BZOJ 1041

    题目描述 给出\(n\),求\(x^2+y^2=n^2,x,y,z\in \mathbb{Z}\)的解数. 复杂度 \(O\left(T_{\mathtt{factorization}}(n)\rig ...

  4. HTK搭建语音拨号系统实验材料下载

    选自:http://maotong.blog.hexun.com/6267266_d.html 压缩包包括全部的配置文件,脚本文件,必备的模型文件和实验手册. 全部实验材料的下载链接: 1 http: ...

  5. QQ登录类

    2015-3-31 22:02:09 (同一套代码, pc端不能登录, 但是, 手机和平板都可以正常登录.....) 1. 首先是库文件, 登录->授权->token->openid ...

  6. SolrCloud环境配置

    Solr是一个企业级搜索服务器,对外提供Web-Service接口,用户可以通过http请求,向搜索引擎提交xml或者json格式的数据,生成索引:然后可以通过http get请求查找,获取返回的xm ...

  7. delphi 快捷键

    1. 编辑器     按键时候请注意输入法: 英文状态 Code Folding (Fold ---Methods)   [Ctrl + Shift] + K + M      

  8. 【编程之美】CPU

    今天开始看编程之美 .第一个问题是CPU的使用率控制,微软的问题果然高大上,我一看就傻了,啥也不知道.没追求直接看答案试了一下.发现自己电脑太好了,4核8线程,程序乱飘.加了一个进程绑定,可以控制一个 ...

  9. 【XLL 框架库函数】 debugPrintf

    通过调用 Windows SDK 函数 OutputDebugStringA 在激活的调试器中输出字符串信息.如果应用程序没有调试器,那么系统调试器就会显示字符串.如果这两种调试器都没使用的话,deb ...

  10. cocos2d-x 第二篇 HelloWorld的流程

    这篇博客主要是带领大家一起了解整个游戏的执行过程,其中涉及的一些譬如导演,场景,层之类的概念将会在后面讲解. 看main函数的区别: #import <UIKit/UIKit.h> // ...