wp8 入门到精通 Animation 背景加字体颜色从下向上变化颜色效果
<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 背景加字体颜色从下向上变化颜色效果的更多相关文章
- wp8 入门到精通 ImageCompress 图片压缩
//实例化选择器 PhotoChooserTask photoChooserTask = new PhotoChooserTask(); BitmapImage bimg; int newPixelW ...
- wp8 入门到精通 虚拟标示符 设备ID
//获得设备虚拟标示符 wp8 public string GetWindowsLiveAnonymousID() { object anid = new object(); string anony ...
- wp8 入门到精通 ---时间
DateTime.Now.ToShortTimeString()DateTime dt = DateTime.Now;dt.ToString();//2005-11-5 13:21:25dt.ToFi ...
- wp8 入门到精通 动画
http://samples.msdn.microsoft.com/Silverlight/SampleBrowser/index.htm#/?sref=transforms_ovw_animatin ...
- wp8 入门到精通
<StackPanel Orientation="Vertical"> <StackPanel Orientation="Horizontal" ...
- wp8 入门到精通 仿美拍评论黑白列表思路
static bool isbool = false; private void BindGameDelete() { Tile tile = new Tile(); List<Color> ...
- wp8 入门到精通 生命周期
- wp8 入门到精通 定时更新瓷贴
public class ScheduledAgent : ScheduledTaskAgent { static ScheduledAgent() { Deployment.Current.Disp ...
- wp8 入门到精通 Gallery
<Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.Resources> ...
随机推荐
- dango foreign key 指定被引用模型的字段
用 to_field pool_no = models.ForeignKey('SimCardPool', verbose_name=u'卡池编号', db_column='pool_no', to_ ...
- Jenkins 报错:(pending—Waiting for next available executor)
系统管理-管理节点,刷新状态
- MySql 导出excel
select * into outfile './bestlovesky.xls' from bestlovesky where 1 order by id desc limit 0, 50;
- Maven打包排除不需要的文件。
pom.xml <!-- package打包排除掉一些配置文件 --> <plugin> <groupId>org.apache.maven.plugins< ...
- 话说好像是这样,ios下面通常用iframe来打开你的scheme地址; Android下通常用location.href来。。。 不过实际情况好像比这个复杂得多。。
http://js.40017.cn/touch/hb/p/openApp.js/** * Created by wsy10943 on 2015/5/18. */ window._web_publi ...
- ubuntu14.04 server 安装vmware worktation 12
0) Do the basic system installation of Ubuntu 14.04 LTS (Server or Desktop) 1) wget the installer wg ...
- linux pep8 检查工具
感谢dongweiming大神.
- 【leetcode】Remove Duplicates from Sorted Array II
Remove Duplicates from Sorted Array II Follow up for "Remove Duplicates":What if duplicate ...
- Linux下cp -rf总是提示覆盖的解决办法
通常情况下使用cp -rf进行文件或者文件夹的管理时一般就不再提醒是否覆盖.然而在内网的一台机器上使用cp -rf却提示是否覆盖.难道和常用的命令不同? [root@xxxx test]# cp -r ...
- ExpressQuantumGrid4的cxGrid的一些使用方法和经验
使用cxGrid有一些时间了,在这里总结一下使用cxGrid的一些方法,希望给刚开始接触cxGrid的人一些帮助. 1.简单介绍:cxGrid右下方的cxGrid1Level1是表示Grid表的层,c ...