博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
wp 取消button按下效果
阅读量:7155 次
发布时间:2019-06-29

本文共 2624 字,大约阅读时间需要 8 分钟。

 <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>

转载于:https://www.cnblogs.com/walleyekneel/p/3518239.html

你可能感兴趣的文章
DataGuard参数配置详解(原创)
查看>>
Android View 如何测量
查看>>
CSS选择器以及优先级与匹配原理
查看>>
PostgreSQL security - don't use password method in pg_hba.conf
查看>>
RDS MySql支持online ddl
查看>>
在Hudson中,使用ant自动对安卓项目编译打包apk
查看>>
【JSP开发】利用request获取各种值
查看>>
Vue全家桶web端社区项目
查看>>
多次Push Pop导致的`Can't add self as subview`问题
查看>>
从萌新的角度理解JVM内存管理
查看>>
d3.js 关于力引导图的简单解析
查看>>
pm2实践指南
查看>>
preload和prefetch
查看>>
Sentry 部署踩坑记
查看>>
哦屋~如此完美的富文本编辑器你值得拥有
查看>>
LeetCode 之 JavaScript 解答第226题 —— 翻转二叉树(Invert Binary Tree)
查看>>
去中心化应用的五大制胜关键
查看>>
CSS布局相关
查看>>
ES6新特性
查看>>
2019年5月-一个从业近两年的小白遇到的面试题
查看>>