<Style x:Key="ButtonStyle2" 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 PhoneFontSizeMediumLarge}"/>
            <Setter Property="Padding" Value="10,3,10,5"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="Transparent">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <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}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

wp 取消button按下效果的更多相关文章

  1. iOS设备下添加button的按下效果

    在触屏上, button的按下效果用:active触发, 但是我发现iOS设备上:active效果并没有生效. :active pseudo-class doesn't work in mobile ...

  2. 取消chrome浏览器下input和textarea的默认样式

    最近一个细节引起了我的注意,chrome浏览器下的input和textarea在聚焦的时候都有一个黄色的边框,而且textarea还可以任意拖动放大,这是不能容忍的,影响美观不说,有时候拖动texta ...

  3. [Android]Button按下后修改背景图

    Button按下后修改背景图 错误做法:为Button添加OnTouch事件监听,根据ACTION_UP和ACTION_DOWN动作来修改Button的背景图 错误原因:从理论上讲,按钮按下修改背景色 ...

  4. 取消chrome浏览器下input和textarea的默认样式;html5默认input内容清除“×”按钮去除办法

    取消chrome浏览器下input和textarea的默认样式: outline:none;/*清空chrome中input的外边框*/ html5默认input内容清除“×”按钮去除办法: inpu ...

  5. ImageButton自定义按钮的按下效果的高效实现方法(非一般)

    通常情况下,我们可以采用如下方式实现: <?xml version="1.0" encoding="UTF-8"?> <selector xm ...

  6. 【Bootstrap3.0建站笔记二】button可下拉弹出层

    1.button可下拉弹出层: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY2hpbmFwbGFu/font/5a6L5L2T/fontsize/400 ...

  7. 给button增加下划线

    如何给button增加下划线简单版   - (void)setUnderLineForButton:(UIButton *)btn withTitle:(NSString *)title{ //利用富 ...

  8. UGUI 实现Button长按效果(RepeatButton)

    Tag:加入了一个延迟,在button按下状态一段时间后再開始 repeate using UnityEngine; using UnityEngine.Events; using UnityEngi ...

  9. gridview里item是textView、Button单击事件相应,以及按下效果的取去除

    1.响应事件的区别: gridview的item是textView的时候,gridview的itemonclick事件可以正常相应,但是换了Button后不能,原因如下: public class B ...

随机推荐

  1. AIX rcp跨主机远程

    rcp用途:在本地主机和远程主机之间或者两个远程主机之间传输文件.详细用法可man rcp查看. 现在要把主机10.200.5.200的/tmp/work.sh(属主为root用户)拷贝到远程主机18 ...

  2. UnQLite简介

    UnQLite是,由Symisc Systems公司出品的一个嵌入式C语言软件库,它实现了一个自包含.无服务器.零配置.事务化的NoSQL数据库引擎.UnQLite是一个文档存储数据库,类似于Mong ...

  3. java代码switch语句求分数等级

    总结:从键盘输入分数----- 如果在0到100内,则输出等级 小于0或者是大于100都不能输出,这里用if-else条件判断. package com.c2; import java.util.Sc ...

  4. php无刷新上传图片

    1. 引入文件 <!--图片上传begin--> <script type="text/javascript" src="/js/jquery.form ...

  5. 微信小程序之巧妙的封装

    巧妙的封装 暴露一个访问地址xapp.config.js module.exports = { api_host: `https://a.squmo.com/yizu` } 继续引入,加暴露api.c ...

  6. AOP(面向切面编程概念,本文为翻译)

    AOP是什么 AOP为Aspect Oriented Programming的缩写.AOP是OOP的延续,是软件开发中的一个热点,也是Spring框架中的一个重要内容,是函数式编程的一种衍生范型.利用 ...

  7. mysql数据增删查授权

    一 介绍 MySQL数据操作: DML ======================================================== 在MySQL管理软件中,可以通过SQL语句中的 ...

  8. 3.solr学习速成之索引添加 查询 删除

    solrserver.java public class solrServer { private solrServer(){}; final static String SOLR_URL = &qu ...

  9. SSD惊悚的跪了,找回数据

    1.电脑出现小bug,例如显示乱码,开机变慢等,都是SSD跪的前兆,哭,我怎么就没看出来,而且没有备份过数据. 2.终于,PC死机了...OK,重启,纳尼?起不来... 3.大哭,所有代码,所有论文不 ...

  10. 转gif图

    用QQ影音截取影片 + Ulead GIF Animator510编辑.