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>

  • 相关阅读:
    antd表单验证图片 必须上传
    interface和type的区别
    Typescript+React封装路由拦截组件
    redux和sessionStorage,localStorage的区别
    ES6中数组和对象的扩展运算符拷贝问题以及常用的深浅拷贝方法
    从变量提升角度看待暂时性死区
    MySQL修改root密码
    用VScode配置Python开发环境
    element UI 制作带月份快捷选项的时间选择器
    React v16.4 的生命周期
  • 原文地址:https://www.cnblogs.com/bruce1992/p/14899940.html
Copyright © 2011-2022 走看看