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>

原文地址:https://www.cnblogs.com/bruce1992/p/14899940.html