• 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>

  • 相关阅读:
    微信开放平台扫码登录回调后 state 参数丢失遗漏的解决方案
    WPF 图片源为空时展示默认图片
    使用批处理(.bat)文件一键编译 .NET CORE 网站并发布至 IIS
    10倍程序员的思考模型
    以TiDB热点问题来谈Region的调度流程
    Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel的解决办法(react Hooks)
    react+tsx+antd表格点击行触发单选复选事件(类型xx上不存在属性xx的解决办法)
    does not exist on type 'JSX.IntrinsicElements'.does not exist on type 'JSX.IntrinsicElements'.的解决办法
    antd-react自定义显示表格操作按钮
    react+tsx+antd关于表单二次弹框
  • 原文地址:https://www.cnblogs.com/bruce1992/p/14899940.html
Copyright © 2020-2023  润新知