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>

  • 相关阅读:
    将现有MySQL数据库改为大小写不敏感
    在Windows中玩转Docker Toolbox
    使用ABP EntityFramework连接MySQL数据库
    数据库设计范式2——BC范式和第四范式
    让OData和NHibernate结合进行动态查询
    文档在线预览的实现
    有哪些老鸟程序员知道而新手不知道的小技巧?自我感受
    EEPROM的概念接口类型及软件实例
    flash的几种模式Normal Mode、DUAL Mode、Quad Mode的概念和区别
    ESP8266 打造一款物联网产品---搭建环境编译及烧录
  • 原文地址:https://www.cnblogs.com/bruce1992/p/14899940.html
Copyright © 2011-2022 走看看