12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
- <Style x:Key="SliderRepeatButtonStyle" TargetType="{x:Type RepeatButton}">
- <Setter Property="OverridesDefaultStyle" Value="true" />
- <Setter Property="IsTabStop" Value="false" />
- <Setter Property="Focusable" Value="false" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RepeatButton}">
- <Rectangle Fill="Transparent" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="HorizontalSliderThumbStyle" TargetType="{x:Type Thumb}">
- <Setter Property="Focusable" Value="false" />
- <Setter Property="OverridesDefaultStyle" Value="true" />
- <Setter Property="Height" Value="20" />
- <Setter Property="Width" Value="20" />
- <Setter Property="Foreground" Value="Gray" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Thumb}">
- <Ellipse
- Fill="#31b0d5"
- Stroke="Gray"
- StrokeThickness="0.5" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="VolumeSliderStyle" TargetType="Slider">
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="HorizontalAlignment" Value="Right" />
- <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Foreground" Value="#FFC4C4C4" />
- <Setter Property="IsSelectionRangeEnabled" Value="True" />
- <Setter Property="SelectionStart" Value="0" />
- <Setter Property="SelectionEnd" Value="{Binding Value, RelativeSource={RelativeSource Mode=Self}}" />
- <Setter Property="Width" Value="230" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Slider}">
- <Border
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- SnapsToDevicePixels="true">
- <Grid>
- <Border
- x:Name="TrackBackground"
- Width="{TemplateBinding Width}"
- Height="8.0"
- Margin="5,0"
- VerticalAlignment="Center"
- Background="#D3D3D3"
- CornerRadius="2">
- <Canvas>
- <Border
- x:Name="PART_SelectionRange"
- Margin="-10,0,0,0"
- Background="#31b0d5"
- CornerRadius="2" />
- </Canvas>
- </Border>
- <Track x:Name="PART_Track">
- <Track.DecreaseRepeatButton>
- <RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource SliderRepeatButtonStyle}" />
- </Track.DecreaseRepeatButton>
- <Track.IncreaseRepeatButton>
- <RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource SliderRepeatButtonStyle}" />
- </Track.IncreaseRepeatButton>
- <Track.Thumb>
- <Thumb x:Name="Thumb" Style="{StaticResource HorizontalSliderThumbStyle}" />
- </Track.Thumb>
- </Track>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelectionRangeEnabled" Value="True">
- <Setter TargetName="PART_SelectionRange" Property="Visibility" Value="Visible" />
- </Trigger>
- <Trigger Property="Orientation" Value="Horizontal">
- <Setter TargetName="PART_SelectionRange" Property="Height" Value="8" />
- </Trigger>
- <Trigger Property="Orientation" Value="Vertical">
- <Setter TargetName="TrackBackground" Property="Width" Value="8" />
- <Setter TargetName="TrackBackground" Property="Height" Value="150" />
- <Setter TargetName="PART_SelectionRange" Property="Width" Value="8" />
- <Setter TargetName="PART_SelectionRange" Property="Margin" Value="0,9,0,0" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|