SilderStyle.xaml 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:local="clr-namespace:AIRS.Properties">
  4. <Style x:Key="SliderRepeatButtonStyle" TargetType="{x:Type RepeatButton}">
  5. <Setter Property="OverridesDefaultStyle" Value="true"/>
  6. <Setter Property="IsTabStop" Value="false"/>
  7. <Setter Property="Focusable" Value="false"/>
  8. <Setter Property="Template">
  9. <Setter.Value>
  10. <ControlTemplate TargetType="{x:Type RepeatButton}">
  11. <Rectangle Fill="Cyan" Height="3"/>
  12. </ControlTemplate>
  13. </Setter.Value>
  14. </Setter>
  15. </Style>
  16. <Style x:Key="HorizontalSliderThumbStyle" TargetType="{x:Type Thumb}">
  17. <Setter Property="Focusable" Value="false"/>
  18. <Setter Property="OverridesDefaultStyle" Value="true"/>
  19. <Setter Property="Height" Value="13"/>
  20. <Setter Property="Width" Value="13"/>
  21. <Setter Property="Foreground" Value="Gray"/>
  22. <Setter Property="Template">
  23. <Setter.Value>
  24. <ControlTemplate TargetType="{x:Type Thumb}">
  25. <Ellipse Fill="#FF009DD9" Stroke="Cyan" StrokeThickness="1.3" Cursor="Hand" />
  26. </ControlTemplate>
  27. </Setter.Value>
  28. </Setter>
  29. </Style>
  30. <Style x:Key="SliderStyle" TargetType="{x:Type Slider}">
  31. <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
  32. <Setter Property="Background" Value="Transparent"/>
  33. <Setter Property="Foreground" Value="#FFC4C4C4"/>
  34. <Setter Property="Template">
  35. <Setter.Value>
  36. <ControlTemplate TargetType="{x:Type Slider}">
  37. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
  38. <Grid>
  39. <Grid.RowDefinitions>
  40. <RowDefinition Height="Auto"/>
  41. <RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
  42. <RowDefinition Height="Auto"/>
  43. </Grid.RowDefinitions>
  44. <TickBar x:Name="TopTick" Fill="{TemplateBinding Foreground}" Height="4" Placement="Top" Grid.Row="0" Visibility="Collapsed"/>
  45. <TickBar x:Name="BottomTick" Fill="{TemplateBinding Foreground}" Height="4" Placement="Bottom" Grid.Row="2" Visibility="Collapsed"/>
  46. <Border x:Name="TrackBackground" CornerRadius="1" Height="5.0" Margin="5,0" Grid.Row="1" VerticalAlignment="center">
  47. <Grid>
  48. <Border Background="#FFF7F4F4" CornerRadius="0.5" Opacity="0.215"/>
  49. <Border Background="#FF132E50" CornerRadius="0.5" Margin="0,0,0.3,0.3" Opacity="0.715"/>
  50. </Grid>
  51. </Border>
  52. <Track x:Name="PART_Track" Grid.Row="1">
  53. <Track.DecreaseRepeatButton>
  54. <RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource SliderRepeatButtonStyle}"/>
  55. </Track.DecreaseRepeatButton>
  56. <Track.IncreaseRepeatButton>
  57. <RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource SliderRepeatButtonStyle}"/>
  58. </Track.IncreaseRepeatButton>
  59. <Track.Thumb>
  60. <Thumb x:Name="Thumb" Style="{StaticResource HorizontalSliderThumbStyle}"/>
  61. </Track.Thumb>
  62. </Track>
  63. </Grid>
  64. </Border>
  65. </ControlTemplate>
  66. </Setter.Value>
  67. </Setter>
  68. </Style>
  69. </ResourceDictionary>