<!--Slider 样式-->
<Style x:Key="StyleForRepeatButton" TargetType="{x:Type RepeatButton}">
<Style.Setters>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush
StartPoint="0.5,0"
EndPoint="0.5,1">
<GradientStop Color="LightGreen" Offset=""/>
<GradientStop Color="Yellow" Offset=""/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Height" Value=""/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Focusable" Value="False"/>
</Style.Setters>
<Style.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0.5,0"
EndPoint="0.5,1">
<GradientStop Color="LightBlue" Offset=""/>
<GradientStop Color="SkyBlue" Offset=""/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
<ControlTemplate x:Key="tmpThumb" TargetType="{x:Type Thumb}">
<Ellipse Name="e" Width="" MinHeight="" Fill="Blue" Cursor="Hand"/>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="e" Property="Fill" Value="Red"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="tmpSlider" TargetType="{x:Type Slider}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto" MinHeight=""/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<TickBar x:Name="top" Fill="Magenta" Grid.Row="" HorizontalAlignment="Stretch"
Placement="Top" Height=""
Visibility="Collapsed"/>
<Track x:Name="PART_Track" Grid.Row="" HorizontalAlignment="Stretch">
<Track.IncreaseRepeatButton>
<RepeatButton Style="{StaticResource StyleForRepeatButton}"
Command="Slider.IncreaseLarge"/>
</Track.IncreaseRepeatButton>
<Track.DecreaseRepeatButton>
<RepeatButton Style="{StaticResource StyleForRepeatButton}"
Command="Slider.DecreaseLarge"/>
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Height="" Template="{StaticResource tmpThumb}"/>
</Track.Thumb>
</Track>
<TickBar x:Name="Bottom" Grid.Row="" Fill="Magenta" HorizontalAlignment="Stretch"
Visibility="Collapsed" Placement="Bottom" Height=""/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="TickPlacement" Value="TopLeft">
<Setter TargetName="top" Property="Visibility" Value="Visible"/>
</Trigger>
<Trigger Property="TickPlacement" Value="BottomRight">
<Setter Property="Visibility" TargetName="Bottom" Value="Visible"/>
</Trigger>
<Trigger Property="TickPlacement" Value="Both">
<Setter TargetName="top" Property="Visibility" Value="Visible"/>
<Setter TargetName="Bottom" Property="Visibility" Value="Visible"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>

ControlTemplate in WPF —— Slider的更多相关文章

  1. WPF Slider滑动条的颜色修改

    效果如下: 鄙人虽然开发WPF有些时间,但之前一直是一些简单Template和Style改改之类的工作,并没有深入研究过.此次为了完成工作,首先也是网上搜了半天,没有找到合适的代码直接拷贝(搜索能力待 ...

  2. [WPF]Slider控件常用方法

    WPF的Slider控件继承自RangeBase类型,同继承自RangeBase的控件还有ProgressBar和ScrollBar,这类控件都是在一定数值范围内表示一个值的用途. 首先注意而Rang ...

  3. wpf slider进度条的样式模板,带有进度颜色显示

    效果图: 仅仅需在前台加上这段代码就可以: <UserControl.Resources> <!--笔刷--> <LinearGradientBrush x:Key=&q ...

  4. ControlTemplate in WPF —— DataGrid

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

  5. ControlTemplate in WPF —— Calendar

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

  6. ControlTemplate in WPF ——ScrollBar

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

  7. ControlTemplate in WPF —— Menu

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

  8. ControlTemplate in WPF —— DatePicker

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

  9. ControlTemplate in WPF —— Expander

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

随机推荐

  1. 08-【jsp重点】

    jsp的四个作用域和9个内置对象 jsp内置对象[重点]:pageContext.request.session.application.response.out.page.exception.con ...

  2. [ZOJ 4025] King of Karaoke

    题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5766 求两个序列的相对元素的差出现次数最多的,最低出现一次. AC代 ...

  3. cubase 的FX轨道使用方法

    FX为辅助通道!

  4. unzip解压3G或者4G以上文件失败的解决方法

    Linux下,使用unzip解压时,报错:End-of-central-directory signature not found.  Either this file is nota zipfile ...

  5. 牛客小白月赛12 C 华华给月月出题 (积性函数,线性筛)

    链接:https://ac.nowcoder.com/acm/contest/392/C 来源:牛客网 华华给月月出题 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 131072K, ...

  6. php程序的生命周期

    1.PHP的运行模式: PHP两种运行模式是WEB模式.CLI模式.无论哪种模式,PHP工作原理都是一样的,作为一种SAPI运行. 1.当我们在终端敲入php这个命令的时候,它使用的是CLI. 它就像 ...

  7. 特殊字符的过滤方法,防sql防注入代码的过滤方法

    特殊字符的过滤方法 function strFilter($str){ //特殊字符的过滤方法 $str = str_replace('`', '', $str); $str = str_replac ...

  8. Windows安装Redis并添加本地自启动服务

    概况 在windows本地搭建redis缓存,添加到本地计算机的服务中,保证每次开机自动启动服务. 第一步:下载redis(我的是计算机win10,64位) https://github.com/Mi ...

  9. 通过jenkins api远程调用job

    curl http://jenkins地址/job/job_name/config.xml --user username:token

  10. Java线程池详解及实例

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.本文链接:https://blog.csdn.net/aa1215018028/article/ ...