zoukankan      html  css  js  c++  java
  • wpf 的style

    <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

        <Style x:Key="ImageButtonStyle" TargetType="Button">

            <Setter Property="BorderBrush" Value="Transparent"/>

            <Setter Property="BorderThickness" Value="0"/>

            <Setter Property="FontFamily" Value="{StaticResource GothamMedium}"/>

            <Setter Property="Foreground" Value="#818181"/>

            <Setter Property="Background" Value="Transparent"/>

            <Setter Property="Template">

                <Setter.Value>

                    <ControlTemplate TargetType="Button">

                        <Border x:Name="border"

                            Background="{TemplateBinding Background}"

        Padding="{TemplateBinding Padding}"

        BorderBrush="{TemplateBinding BorderBrush}"

        BorderThickness="{TemplateBinding BorderThickness}"

        SnapsToDevicePixels="True"

                            CornerRadius="3">

                            <ContentPresenter Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center"

            Focusable="False" RecognizesAccessKey="True"/>

                        </Border>

                        <ControlTemplate.Triggers>

                            <Trigger Property="IsMouseOver" Value="True">

                                <Setter TargetName="border" Property="Background" Value="#3F3F3F"/>

                            </Trigger>

                        </ControlTemplate.Triggers>

                    </ControlTemplate>

                </Setter.Value>

            </Setter>

        </Style>

    </ResourceDictionary>

    wpf style

    ---------------------------------------------------------

    <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

        <Style x:Key="ToggleButtonStyle" TargetType="ToggleButton">

            <Setter Property="Foreground" Value="#818181"/>

            <Setter Property="Background" Value="Transparent"/>

            <Setter Property="HorizontalContentAlignment" Value="Center"/>

            <Setter Property="VerticalContentAlignment" Value="Center"/>

            <Setter Property="HorizontalAlignment" Value="Center"/>

            <Setter Property="IsChecked" Value="False"/>

            <Setter Property="BorderBrush" Value="Transparent"/>

            <Setter Property="BorderThickness" Value="0"/>

            <Setter Property="Template">

                <Setter.Value>

                    <ControlTemplate TargetType="ToggleButton">

                        <Border x:Name="border"

                            Background="{TemplateBinding Background}"

        Padding="{TemplateBinding Padding}"

        BorderBrush="{TemplateBinding BorderBrush}"

        BorderThickness="{TemplateBinding BorderThickness}"

        SnapsToDevicePixels="True"

                            CornerRadius="3">

                            <ContentPresenter Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center"

            Focusable="False" RecognizesAccessKey="True"/>

                        </Border>

                        <ControlTemplate.Triggers>

                            <Trigger Property="IsMouseOver" Value="True">

                                <Setter TargetName="border" Property="Background" Value="#3F3F3F"/>

                            </Trigger>

                            <Trigger Property="IsChecked" Value="True">

                                <Setter TargetName="border" Property="Background" Value="#595959"/>

                            </Trigger>

                        </ControlTemplate.Triggers>

                    </ControlTemplate>

                </Setter.Value>

            </Setter>

        </Style>

    </ResourceDictionary>

    wpf style

    ---------------------------------------------------------------------------------

  • 相关阅读:
    蒟蒻Orion还要学的东西!
    一些技巧 && 常数优化 && 出现の错误 [绝赞更新中!]
    [US Open 2004][luogu2342] 叠积木 [带权并查集]
    省选算法学习·一些数列相关的数学知识 [数学]
    [BJOI2019] 奥术神杖 [取log+AC自动机+dp]
    [BJOI2019] 删数 [dp转贪心结论+线段树]
    [2018国家集训队][UOJ449] 喂鸽子 [dp+组合数学]
    [2018集训队作业][UOJ424] count [笛卡尔树+括号序列+折线法+组合数学]
    [2018集训队作业][UOJ450] 复读机 [DP+泰勒展开+单位根反演]
    [SDOI2014][BZOJ3533] 向量集 [线段树+凸包]
  • 原文地址:https://www.cnblogs.com/bruce1992/p/14851891.html
Copyright © 2011-2022 走看看