123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
- <Style TargetType="{x:Type Slider}" x:Key="SliderStyle"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:s="clr-namespace:System;assembly=mscorlib">
- <Style.Triggers>
- <Trigger Property="Slider.Orientation"
- Value="Vertical">
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Slider}">
- <Border BorderThickness="{TemplateBinding Border.BorderThickness}"
- BorderBrush="{TemplateBinding Border.BorderBrush}"
- Background="{TemplateBinding Panel.Background}"
- Name="border"
- SnapsToDevicePixels="True">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto"
- MinWidth="{TemplateBinding FrameworkElement.MinWidth}" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <TickBar Fill="{TemplateBinding TextElement.Foreground}"
- Placement="Left"
- Name="TopTick"
- Width="4"
- Margin="0,0,2,0"
- Visibility="Collapsed"
- Grid.Column="0" />
- <TickBar Fill="{TemplateBinding TextElement.Foreground}"
- Placement="Right"
- Name="BottomTick"
- Width="4"
- Margin="2,0,0,0"
- Visibility="Collapsed"
- Grid.Column="2" />
- <Border BorderThickness="1"
- BorderBrush="#D6D6D6"
- Background="#E7EAEA"
- Name="TrackBackground"
- Width="4"
- Margin="0,5"
- HorizontalAlignment="Center"
- Grid.Column="1">
- <Canvas Margin="-1,-6">
- <Rectangle Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"
- Name="PART_SelectionRange"
- Width="4"
- Visibility="Hidden" />
- </Canvas>
- </Border>
- <Track Name="PART_Track"
- Grid.Column="1">
- <Track.DecreaseRepeatButton>
- <RepeatButton>
- <RepeatButton.Command>
- <RoutedCommand />
- </RepeatButton.Command>
- <RepeatButton.Style>
- <Style TargetType="{x:Type RepeatButton}">
- <Setter Property="FrameworkElement.OverridesDefaultStyle"
- Value="True" />
- <Setter Property="Panel.Background"
- Value="#00FFFFFF" />
- <Setter Property="UIElement.Focusable"
- Value="False" />
- <Setter Property="KeyboardNavigation.IsTabStop"
- Value="False" />
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RepeatButton}">
- <Rectangle Fill="{TemplateBinding Panel.Background}"
- Width="{TemplateBinding FrameworkElement.Width}"
- Height="2" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </RepeatButton.Style>
- </RepeatButton>
- </Track.DecreaseRepeatButton>
- <Track.Thumb>
- <Thumb OverridesDefaultStyle="True"
- Name="Thumb"
- Width="18"
- Height="11"
- VerticalAlignment="Top"
- Focusable="False">
- <Thumb.Template>
- <ControlTemplate TargetType="{x:Type Thumb}">
- <Grid UseLayoutRounding="True"
- HorizontalAlignment="Center"
- VerticalAlignment="Center">
- <Path
- Stretch="Fill"
- Fill="#477EDE"
- Stroke="#477EDE"
- StrokeThickness="1"
- UseLayoutRounding="True"
- Name="grip"
- VerticalAlignment="Center"
- SnapsToDevicePixels="True" >
- <Path.Data>
- <RectangleGeometry Rect="0,0,8,16" RadiusX="4" RadiusY="4"></RectangleGeometry>
- </Path.Data>
- </Path>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="UIElement.IsMouseOver"
- Value="True">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- <Trigger Property="Thumb.IsDragging"
- Value="True">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- <Trigger Property="UIElement.IsEnabled"
- Value="False">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Thumb.Template>
- </Thumb>
- </Track.Thumb>
- <Track.IncreaseRepeatButton>
- <RepeatButton>
- <RepeatButton.Command>
- <RoutedCommand />
- </RepeatButton.Command>
- <RepeatButton.Style>
- <Style TargetType="{x:Type RepeatButton}">
- <Setter Property="FrameworkElement.OverridesDefaultStyle"
- Value="True" />
- <Setter Property="Panel.Background"
- Value="#00FFFFFF" />
- <Setter Property="UIElement.Focusable"
- Value="False" />
- <Setter Property="KeyboardNavigation.IsTabStop"
- Value="False" />
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RepeatButton}">
- <Rectangle Fill="{TemplateBinding Panel.Background}"
- Width="{TemplateBinding FrameworkElement.Width}"
- Height="2" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </RepeatButton.Style>
- </RepeatButton>
- </Track.IncreaseRepeatButton>
- </Track>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="Slider.TickPlacement"
- Value="TopLeft">
- <Setter Property="UIElement.Visibility"
- TargetName="TopTick"
- Value="Visible" />
- <Setter Property="Control.Template"
- TargetName="Thumb">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Thumb}">
- <Grid UseLayoutRounding="True"
- HorizontalAlignment="Center"
- VerticalAlignment="Center">
- <Path
- Stretch="Fill"
- Fill="#477EDE"
- Stroke="#477EDE"
- StrokeThickness="1"
- UseLayoutRounding="True"
- Name="grip"
- VerticalAlignment="Center"
- SnapsToDevicePixels="True" >
- <Path.Data>
- <RectangleGeometry Rect="0,0,8,16" RadiusX="4" RadiusY="4"></RectangleGeometry>
- </Path.Data>
- </Path>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="UIElement.IsMouseOver"
- Value="True">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- <Trigger Property="Thumb.IsDragging"
- Value="True">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- <Trigger Property="UIElement.IsEnabled"
- Value="False">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="FrameworkElement.Margin"
- TargetName="TrackBackground"
- Value="2,5,0,5" />
- </Trigger>
- <Trigger Property="Slider.TickPlacement"
- Value="BottomRight">
- <Setter Property="UIElement.Visibility"
- TargetName="BottomTick"
- Value="Visible" />
- <Setter Property="Control.Template"
- TargetName="Thumb">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Thumb}">
- <Grid UseLayoutRounding="True"
- HorizontalAlignment="Center"
- VerticalAlignment="Center">
- <Path
- Stretch="Fill"
- Fill="#477EDE"
- Stroke="#477EDE"
- StrokeThickness="1"
- UseLayoutRounding="True"
- Name="grip"
- VerticalAlignment="Center"
- SnapsToDevicePixels="True" >
- <Path.Data>
- <RectangleGeometry Rect="0,0,8,16" RadiusX="4" RadiusY="4"></RectangleGeometry>
- </Path.Data>
- </Path>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="UIElement.IsMouseOver"
- Value="True">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- <Trigger Property="Thumb.IsDragging"
- Value="True">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- <Trigger Property="UIElement.IsEnabled"
- Value="False">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="FrameworkElement.Margin"
- TargetName="TrackBackground"
- Value="0,5,2,5" />
- </Trigger>
- <Trigger Property="Slider.TickPlacement"
- Value="Both">
- <Setter Property="UIElement.Visibility"
- TargetName="TopTick"
- Value="Visible" />
- <Setter Property="UIElement.Visibility"
- TargetName="BottomTick"
- Value="Visible" />
- </Trigger>
- <Trigger Property="Slider.IsSelectionRangeEnabled"
- Value="True">
- <Setter Property="UIElement.Visibility"
- TargetName="PART_SelectionRange"
- Value="Visible" />
- </Trigger>
- <Trigger Property="UIElement.IsKeyboardFocused"
- Value="True">
- <Setter Property="TextElement.Foreground"
- TargetName="Thumb"
- Value="#0000FF" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Trigger>
- </Style.Triggers>
- <Setter Property="Stylus.IsPressAndHoldEnabled"
- Value="False" />
- <Setter Property="Panel.Background"
- Value="#00FFFFFF" />
- <Setter Property="Border.BorderBrush"
- Value="#00FFFFFF" />
- <Setter Property="TextElement.Foreground"
- Value="#E5E5E5" />
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Slider}">
- <Border BorderThickness="{TemplateBinding Border.BorderThickness}"
- BorderBrush="{TemplateBinding Border.BorderBrush}"
- Background="{TemplateBinding Panel.Background}"
- Name="border"
- SnapsToDevicePixels="True">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto"
- MinHeight="{TemplateBinding FrameworkElement.MinHeight}" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <TickBar Fill="{TemplateBinding TextElement.Foreground}"
- Placement="Top"
- Name="TopTick"
- Height="4"
- Margin="0,2,0,0"
- Visibility="Collapsed"
- Grid.Row="0" />
- <TickBar Fill="{TemplateBinding TextElement.Foreground}"
- Placement="Bottom"
- Name="BottomTick"
- Height="4"
- Margin="0,0,0,2"
- Visibility="Collapsed"
- Grid.Row="2" />
- <Border BorderThickness="0"
- BorderBrush="#D6D6D6"
- Background="#FFE2E3E6"
- Name="TrackBackground"
- Height="4"
- Margin="5,0"
- VerticalAlignment="Center"
- Grid.Row="1">
- <Canvas Margin="-6,-1">
- <Rectangle Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"
- Name="PART_SelectionRange"
- Height="4"
- Visibility="Hidden" />
- </Canvas>
- </Border>
- <Track Name="PART_Track"
- Grid.Row="1">
- <Track.DecreaseRepeatButton>
- <RepeatButton>
- <RepeatButton.Command>
- <RoutedCommand />
- </RepeatButton.Command>
- <RepeatButton.Style>
- <Style TargetType="{x:Type RepeatButton}">
- <Setter Property="FrameworkElement.OverridesDefaultStyle"
- Value="True" />
- <Setter Property="Panel.Background"
- Value="#00FFFFFF" />
- <Setter Property="UIElement.Focusable"
- Value="False" />
- <Setter Property="KeyboardNavigation.IsTabStop"
- Value="False" />
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RepeatButton}">
- <Rectangle Fill="{TemplateBinding Panel.Background}"
- Width="{TemplateBinding FrameworkElement.Width}"
- Height="{TemplateBinding FrameworkElement.Height}" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </RepeatButton.Style>
- </RepeatButton>
- </Track.DecreaseRepeatButton>
- <Track.Thumb>
- <Thumb OverridesDefaultStyle="True"
- Name="Thumb"
- Width="8"
- Height="16"
- VerticalAlignment="Center"
- Focusable="False">
- <Thumb.Template>
- <ControlTemplate TargetType="{x:Type Thumb}">
- <Grid UseLayoutRounding="True"
- HorizontalAlignment="Center"
- VerticalAlignment="Center">
- <Path
- Stretch="Fill"
- Fill="#477EDE"
- Stroke="#477EDE"
- StrokeThickness="1"
- UseLayoutRounding="True"
- Name="grip"
- VerticalAlignment="Center"
- SnapsToDevicePixels="True" >
- <Path.Data>
- <RectangleGeometry Rect="0,0,8,16" RadiusX="4" RadiusY="4"></RectangleGeometry>
- </Path.Data>
- </Path>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="UIElement.IsMouseOver"
- Value="True">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- <Trigger Property="Thumb.IsDragging"
- Value="True">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- <Trigger Property="UIElement.IsEnabled"
- Value="False">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Thumb.Template>
- </Thumb>
- </Track.Thumb>
- <Track.IncreaseRepeatButton>
- <RepeatButton>
- <RepeatButton.Command>
- <RoutedCommand />
- </RepeatButton.Command>
- <RepeatButton.Style>
- <Style TargetType="{x:Type RepeatButton}">
- <Setter Property="FrameworkElement.OverridesDefaultStyle"
- Value="True" />
- <Setter Property="Panel.Background"
- Value="#00FFFFFF" />
- <Setter Property="UIElement.Focusable"
- Value="False" />
- <Setter Property="KeyboardNavigation.IsTabStop"
- Value="False" />
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RepeatButton}">
- <Rectangle Fill="{TemplateBinding Panel.Background}"
- Width="{TemplateBinding FrameworkElement.Width}"
- Height="{TemplateBinding FrameworkElement.Height}"
- />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </RepeatButton.Style>
- </RepeatButton>
- </Track.IncreaseRepeatButton>
- </Track>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="Slider.TickPlacement"
- Value="TopLeft">
- <Setter Property="UIElement.Visibility"
- TargetName="TopTick"
- Value="Visible" />
- <Setter Property="Control.Template"
- TargetName="Thumb">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Thumb}">
- <Grid UseLayoutRounding="True"
- HorizontalAlignment="Center"
- VerticalAlignment="Center">
- <Path
- Stretch="Fill"
- Fill="#477EDE"
- Stroke="#477EDE"
- StrokeThickness="1"
- UseLayoutRounding="True"
- Name="grip"
- VerticalAlignment="Center"
- SnapsToDevicePixels="True" >
- <Path.Data>
- <RectangleGeometry Rect="0,0,8,16" RadiusX="4" RadiusY="4"></RectangleGeometry>
- </Path.Data>
- </Path>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="UIElement.IsMouseOver"
- Value="True">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- <Trigger Property="Thumb.IsDragging"
- Value="True">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- <Trigger Property="UIElement.IsEnabled"
- Value="False">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="FrameworkElement.Margin"
- TargetName="TrackBackground"
- Value="5,2,5,0" />
- </Trigger>
- <Trigger Property="Slider.TickPlacement"
- Value="BottomRight">
- <Setter Property="UIElement.Visibility"
- TargetName="BottomTick"
- Value="Visible" />
- <Setter Property="Control.Template"
- TargetName="Thumb">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Thumb}">
- <Grid UseLayoutRounding="True"
- HorizontalAlignment="Center"
- VerticalAlignment="Center">
- <Path
- Stretch="Fill"
- Fill="#477EDE"
- Stroke="#477EDE"
- StrokeThickness="1"
- UseLayoutRounding="True"
- Name="grip"
- VerticalAlignment="Center"
- SnapsToDevicePixels="True" >
- <Path.Data>
- <RectangleGeometry Rect="0,0,8,16" RadiusX="4" RadiusY="4"></RectangleGeometry>
- </Path.Data>
- </Path>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="UIElement.IsMouseOver"
- Value="True">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- <Trigger Property="Thumb.IsDragging"
- Value="True">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- <Trigger Property="UIElement.IsEnabled"
- Value="False">
- <Setter Property="Shape.Fill"
- TargetName="grip"
- Value="#477EDE" />
- <Setter Property="Shape.Stroke"
- TargetName="grip"
- Value="#477EDE" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="FrameworkElement.Margin"
- TargetName="TrackBackground"
- Value="5,0,5,2" />
- </Trigger>
- <Trigger Property="Slider.TickPlacement"
- Value="Both">
- <Setter Property="UIElement.Visibility"
- TargetName="TopTick"
- Value="Visible" />
- <Setter Property="UIElement.Visibility"
- TargetName="BottomTick"
- Value="Visible" />
- </Trigger>
- <Trigger Property="Slider.IsSelectionRangeEnabled"
- Value="True">
- <Setter Property="UIElement.Visibility"
- TargetName="PART_SelectionRange"
- Value="Visible" />
- </Trigger>
- <Trigger Property="UIElement.IsKeyboardFocused"
- Value="True">
- <Setter Property="TextElement.Foreground"
- TargetName="Thumb"
- Value="#0000FF" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="SelectionStart" Value="{Binding Minimum, RelativeSource={RelativeSource Self}}" />
- <Setter Property="SelectionEnd" Value="{Binding Value, RelativeSource={RelativeSource Self}}" />
- </Style>
- </ResourceDictionary>
|