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>

  • 相关阅读:
    Expect学习笔记(1)
    Awk 实例,第 3 部分
    ELF文件格式(中文版)
    sed 实例,第 1 部分
    Expect 教程中文版
    csc工具一般使用说明zz
    Microsoft Office Word 2010(zz)
    记录XPO查询 日志
    C#中判断文件或文件夹是否存在
    Discuz数据库结构1
  • 原文地址:https://www.cnblogs.com/bruce1992/p/14899940.html
Copyright © 2011-2022 走看看