<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. python的变量作用域问题

    偶然掉进了一个坑里.仔细分析了下原因.原来是变量作用域的问题.简单抽象如下: id=1 #许多行代码 [id for id in range(10)] #许多行代码 if id!=1: #做一些事情 ...

  2. sone2(未完成)

    先留个半完成代码 边看论文边看题解写的...难受.. #include<cstdio> #include<cstring> namespace utils{ inline in ...

  3. dtw算法优化(重写C语言版本)

    1.缩小搜索范围 2.降低内存消耗

  4. Oracle中创建MD5方法

    create or replace function MD5(passwd in varchar2) return varchar2 is retval ); begin retval := utl_ ...

  5. poj 1028

    http://poj.org/problem?id=1028 题意(水):做一个游览器的历史记录. back:后退到上一个页面,当上一个页面没有时,输出ignored. forward:向前一个页面, ...

  6. CentOS 6.x 系统安装选项说明

    在安装CentOS 6.x的过程中会出现以下界面: 这些选项有什么区别呢?转载一位网友的描述: Desktop:基本的桌面系统,包括常用的桌面软件,如文档查看工具 Minimal Desktop:基本 ...

  7. winform,wpf,winrt获取屏幕分辨率

    winform 当前的屏幕除任务栏外的工作域大小     this.Width = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Widt ...

  8. VC++ 模块与资源分离

    在一些开发过程中,需要模块支持中英文语言切换,比较好的实现方式是从模块中将资源分离出来,做成中英文两个资源dll,根据需要加载不同的dll从而实现切换不同的语言显示. 新建一个资源dll文件,选择Wi ...

  9. BestCoder36 1002.Gunner 解题报告

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5199 题目意思:给出鸟在树上的高度,以及射击到的高度,问每次射击能射中鸟的数量 用 vector 里面 ...

  10. 【leetcode】Remove Duplicates from Sorted List II (middle)

    Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numb ...