zoukankan      html  css  js  c++  java
  • WPF 中的 button style 的修改

    <Style x:Key="ButtonStyleTransBack"

               TargetType="Button">

            <Setter Property="Background"

                    Value="Transparent" />

            <Setter Property="BorderBrush"

                    Value="Transparent" />

            <Setter Property="BorderThickness"

                    Value="0" />

            <Setter Property="Padding"

                    Value="0" />

            <Setter Property="Template">

                <Setter.Value>

                    <ControlTemplate TargetType="Button">

                        <ContentPresenter x:Name="ContentPresenter"

                                          AutomationProperties.AccessibilityView="Raw"

                                          Foreground="{TemplateBinding Foreground}"

                                          BackgroundSizing="{TemplateBinding BackgroundSizing}"

                                          Background="{TemplateBinding Background}"

                                          BorderThickness="{TemplateBinding BorderThickness}"

                                          BorderBrush="{TemplateBinding BorderBrush}"

                                          ContentTemplate="{TemplateBinding ContentTemplate}"

                                          Content="{TemplateBinding Content}"

                                          CornerRadius="{TemplateBinding CornerRadius}"

                                          ContentTransitions="{TemplateBinding ContentTransitions}"

                                          HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"

                                          Padding="{TemplateBinding Padding}"

                                          VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">

                            <VisualStateManager.VisualStateGroups>

                                <VisualStateGroup x:Name="CommonStates">

                                    <VisualState x:Name="Normal">

                                        <Storyboard>

                                            <PointerUpThemeAnimation Storyboard.TargetName="ContentPresenter" />

                                        </Storyboard>

                                    </VisualState>

                                    <VisualState x:Name="PointerOver">

                                        <Storyboard>

                                            <PointerUpThemeAnimation Storyboard.TargetName="ContentPresenter" />

                                        </Storyboard>

                                    </VisualState>

                                    <VisualState x:Name="Pressed">

                                        <Storyboard>

                                            <PointerDownThemeAnimation Storyboard.TargetName="ContentPresenter" />

                                        </Storyboard>

                                    </VisualState>

                                    <VisualState x:Name="Disabled">

                                    </VisualState>

                                </VisualStateGroup>

                            </VisualStateManager.VisualStateGroups>

                        </ContentPresenter>

                    </ControlTemplate>

                </Setter.Value>

            </Setter>

        </Style>

  • 相关阅读:
    玉米不怕累,宇春最珍贵
    幸福
    谷歌位置搜索 蹩脚结合jquery.ui.gmap
    Resharp Format XML config
    正则表达取得 image src 中值
    一个Gif处理的类库
    使用nuGet管理自己的包
    正则表达式语言 快速参考
    动态加入JS及加入CSS
    检测是一个时间串或一个数字串是否连续
  • 原文地址:https://www.cnblogs.com/bruce1992/p/14899940.html
Copyright © 2011-2022 走看看