<!--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. deep_learning_Function_tensorboard的使用

    数据可视化(网页能打开,但是没有数据):https://jingyan.baidu.com/article/e9fb46e1c55ac93520f7666b.html

  2. BLE 5协议栈-安全管理层

    文章转载自:http://www.sunyouqun.com/2017/04/ 安全管理(Security Manager)定义了设备间的配对过程. 配对过程包括了配对信息交换.生成密钥和交换密钥三个 ...

  3. storcli/percli的使用场景

    目录 storcli/percli常用场景 storcli/percli常用场景 查看帮助信息 storcli64 help 查看控制器数量 storcli64 show ctrlcount [roo ...

  4. 异步任务——AsyncTask的初步认识

    ProgressBar_test.class package com.example.administrator.ten_9; import android.app.Activity; import ...

  5. Python3多线程爬取meizitu的图片

    python环境:python3 运行环境:win10和linux都可以,其他系统没测 1 安装依赖 pip install requests pip install lxml pip install ...

  6. 检测udp端口

    linux 检测端口是否打开:nc -zuv ip 端口 服务器监听端口:nc -l -u ip 端口(可以发送和接受信息) 客户端检测端口:nc -u ip 端口(可以发送和接受信息) 查看监听的t ...

  7. Selenium(5)

    一.WebDriver结合Junit的使用 1.Junit中常用的断言 (1)assertEquals:断言实际结果与预期结果是否相等 Equals:相等 格式:assertEquals(预期值,实际 ...

  8. C#DataTable导出Excel,并实现合并单元格

    asp.net webwofrm后台代码----------建议Framework4.0及以上,3.5试过出现好多莫名错误... 首先导入两个程序集.我的是 office2003,引用的COM里面的  ...

  9. tornado框架自定义中间件过程中的一些基础技术(1)

    为了检查当前请求是否在用户的权限列表中,我们需要获取uri(也就是当前链接),下列代码说明了获取的过程,也证明了python魔术方法的重要性class testHandler(RequestHandl ...

  10. 【Java Web】简易商品信息管理系统——首个Web项目

    正文之前 在学习了一段时间的Java Web的内容之后,当然需要有个项目来练练手,我相信大多数人的首选项目都是信息管理系统吧,所以我选择了商品信息管理系统 目前项目源码已全部上传至GitHub,欢迎大 ...