<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

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

wpf 的style的更多相关文章

  1. WPF 之 style文件的引用

    总结一下WPF中Style样式的引用方法. 一.内联样式: 直接设置控件的Height.Width.Foreground.HorizontalAlignment.VerticalAlignment等属 ...

  2. WPF的Style的TargetType不同写法的异同

    原文:WPF的Style的TargetType不同写法的异同 <Style TargetType="TextBlock"> <Setter Property=&q ...

  3. WPF中Style文件的引用——使用xaml代码或者C#代码动态加载

    原文:WPF中Style文件的引用--使用xaml代码或者C#代码动态加载 WPF中控件拥有很多依赖属性(Dependency Property),我们可以通过编写自定义Style文件来控制控件的外观 ...

  4. WPF 中style文件的引用

    原文:WPF 中style文件的引用 总结一下WPF中Style样式的引用方法: 一,内联样式: 直接设置控件的Height.Width.Foreground.HorizontalAlignment. ...

  5. WPF整理-Style

    "Consistency in a user interface is an important trait; there are many facets of consistency,   ...

  6. [WPF] 为Style 里的button添加鼠标点击响应事件

    一个TabControl, 用的是PagedTabControl style, 在style中有个button, button在style里已经写了click事件,但是现在还需要加上一段功能,就是在响 ...

  7. WPF's Style BasedOn

    <Style x:Key="BasedStyle" BasedOn="{x:Null}" TargetType="{x:Type Control ...

  8. WPF系列 Style

        参考 WPF: Customize your Application with Styles and Control Templates (Part 2 of 2)

  9. wpf 将Style应用到 ListView 中的 ListViewItem 元素

    例: 为每个条目元素设置右键菜单 1. 新建右键菜单元素和样式元素 注意: 同时设置样式元素的 TargetType 属性和 x:Key 属性, 将样式元素限定为应用于 ListViewItem 类型 ...

随机推荐

  1. [网络流24题]最长k可重线段集[题解]

    最长 \(k\) 可重线段集 题目大意 给定平面 \(x-O-y\) 上 \(n\) 个开线段组成的集合 \(I\) ,和一个正整数 \(k\) .试设计一个算法,从开线段集合 \(I\) 中选取开线 ...

  2. 交通规则:HOV车道

    多乘员车道的限行时间一般为工作日上下班高峰,车上只有一个人时不能走该车道

  3. WIN10技巧

    1.快速打开"开始---自动启动"文件夹:开始--支行--shell:startup 2

  4. asp.net 网页图片URL

    "upload/"+Eval("kemu")+"/"+Eval("tx")+".jpg" " ...

  5. python numpy 数据集合操作函数

    arrarray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])arr1array([0, 1, 2, 3, 4])np.intersect1d(arr,arr1)#计算数组ARR A ...

  6. [iconfont_dart]帮你快速生成Icon,再也不用手动写Icon方法

    iconfont_dart iconfont to dart.Icon can be implemented by calling iconfont classname. iconfont转dart. ...

  7. WSL2:Windows 亲生的 Linux 子系统

    作 者:道哥,10+年的嵌入式开发老兵. 公众号:[IOT物联网小镇],专注于:C/C++.Linux操作系统.应用程序设计.物联网.单片机和嵌入式开发等领域. 公众号回复[书籍],获取 Linux. ...

  8. fiddler抓取手机模拟器数据

    引自:https://blog.csdn.net/lengdaochuqiao/article/details/88170522 1.下载最新版fiddler ,强烈建议在官网下载:https://w ...

  9. BigDecimal之除不尽报错

    当bigdecimal除不尽(循环小数)后会报错,下面的是BigDecimal ,divide方法提供的精确小数方法(推荐使用) BigDecimal avgCapital = loanAmount. ...

  10. U盘启动盘安装win10出现cdboot:couldn't find ntldr

    格式化硬盘后出现:cdboot:couldn't find ntldr  解决方法: 分区时格式选择:硬盘格式导致的,一般出现在win10装win7时,需要用pe系统里的分区工具重新给为硬盘分区,并将 ...