更新
This commit is contained in:
@@ -1,13 +1,6 @@
|
||||
<!--
|
||||
This Source Code Form is subject to the terms of the MIT License.
|
||||
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
|
||||
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
|
||||
All Rights Reserved.
|
||||
-->
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Style x:Key="UiSliderButtonStyle" TargetType="{x:Type RepeatButton}">
|
||||
<Style TargetType="{x:Type RepeatButton}" x:Key="UiSliderButtonStyle">
|
||||
<Setter Property="IsTabStop" Value="False" />
|
||||
<Setter Property="Focusable" Value="False" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
@@ -21,15 +14,15 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="UiSliderThumbStyle" TargetType="{x:Type Thumb}">
|
||||
<Style TargetType="{x:Type Thumb}" x:Key="UiSliderThumbStyle">
|
||||
<Setter Property="Height" Value="20" />
|
||||
<Setter Property="Width" Value="20" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource SliderThumbBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource SystemFillColorAttentionBrush}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="Background" Value="{DynamicResource SliderOuterThumbBackground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ControlSolidFillColorDefaultBrush}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Thumb}">
|
||||
@@ -39,12 +32,12 @@
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="16">
|
||||
<Ellipse
|
||||
x:Name="Ellipse"
|
||||
Width="12"
|
||||
Height="12"
|
||||
Fill="{TemplateBinding Foreground}"
|
||||
Height="12"
|
||||
Stroke="Transparent"
|
||||
StrokeThickness="0" />
|
||||
StrokeThickness="0"
|
||||
Width="12"
|
||||
x:Name="Ellipse" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
@@ -52,7 +45,7 @@
|
||||
</Style>
|
||||
|
||||
<!-- Template when the orientation of the Slider is Horizontal. -->
|
||||
<ControlTemplate x:Key="UiHorizontalSlider" TargetType="{x:Type Slider}">
|
||||
<ControlTemplate TargetType="{x:Type Slider}" x:Key="UiHorizontalSlider">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -60,117 +53,117 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<TickBar
|
||||
x:Name="TopTick"
|
||||
Fill="{DynamicResource ControlStrongFillColorDefaultBrush}"
|
||||
Grid.Row="0"
|
||||
Height="6"
|
||||
Fill="{DynamicResource SliderTickBarFill}"
|
||||
Placement="Top"
|
||||
SnapsToDevicePixels="True"
|
||||
Visibility="Collapsed" />
|
||||
Visibility="Collapsed"
|
||||
x:Name="TopTick" />
|
||||
<Border
|
||||
x:Name="TrackBackground"
|
||||
Background="{DynamicResource ControlStrongFillColorDefaultBrush}"
|
||||
BorderThickness="0"
|
||||
CornerRadius="2"
|
||||
Grid.Row="1"
|
||||
Height="4"
|
||||
Margin="0"
|
||||
Background="{DynamicResource SliderTrackFill}"
|
||||
BorderThickness="0"
|
||||
CornerRadius="2" />
|
||||
<Track x:Name="PART_Track" Grid.Row="1">
|
||||
x:Name="TrackBackground" />
|
||||
<Track Grid.Row="1" x:Name="PART_Track">
|
||||
<Track.DecreaseRepeatButton>
|
||||
<RepeatButton Command="Slider.DecreaseLarge" Style="{StaticResource UiSliderButtonStyle}" />
|
||||
</Track.DecreaseRepeatButton>
|
||||
<Track.Thumb>
|
||||
<Thumb x:Name="Thumb" Style="{StaticResource UiSliderThumbStyle}" />
|
||||
<Thumb Style="{StaticResource UiSliderThumbStyle}" x:Name="Thumb" />
|
||||
</Track.Thumb>
|
||||
<Track.IncreaseRepeatButton>
|
||||
<RepeatButton Command="Slider.IncreaseLarge" Style="{StaticResource UiSliderButtonStyle}" />
|
||||
</Track.IncreaseRepeatButton>
|
||||
</Track>
|
||||
<TickBar
|
||||
x:Name="BottomTick"
|
||||
Fill="{DynamicResource ControlStrongFillColorDefaultBrush}"
|
||||
Grid.Row="2"
|
||||
Height="6"
|
||||
Fill="{DynamicResource SliderTickBarFill}"
|
||||
Placement="Bottom"
|
||||
SnapsToDevicePixels="True"
|
||||
Visibility="Collapsed" />
|
||||
Visibility="Collapsed"
|
||||
x:Name="BottomTick" />
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="TickPlacement" Value="TopLeft">
|
||||
<Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
|
||||
<Setter Property="Visibility" TargetName="TopTick" Value="Visible" />
|
||||
</Trigger>
|
||||
<Trigger Property="TickPlacement" Value="BottomRight">
|
||||
<Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
|
||||
<Setter Property="Visibility" TargetName="BottomTick" Value="Visible" />
|
||||
</Trigger>
|
||||
<Trigger Property="TickPlacement" Value="Both">
|
||||
<Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
|
||||
<Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
|
||||
<Setter Property="Visibility" TargetName="TopTick" Value="Visible" />
|
||||
<Setter Property="Visibility" TargetName="BottomTick" Value="Visible" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="TrackBackground" Property="Background" Value="{DynamicResource SliderTrackFillPointerOver}" />
|
||||
<Setter TargetName="Thumb" Property="Foreground" Value="{DynamicResource SliderThumbBackgroundPointerOver}" />
|
||||
<Setter Property="Background" TargetName="TrackBackground" Value="{DynamicResource ControlStrongFillColorDefaultBrush}" />
|
||||
<Setter Property="Foreground" TargetName="Thumb" Value="{DynamicResource SystemFillColorAttentionBrush}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<!-- Template when the orientation of the Slider is Vertical. -->
|
||||
<ControlTemplate x:Key="UiVerticalSlider" TargetType="{x:Type Slider}">
|
||||
<ControlTemplate TargetType="{x:Type Slider}" x:Key="UiVerticalSlider">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" MinWidth="{TemplateBinding MinWidth}" />
|
||||
<ColumnDefinition MinWidth="{TemplateBinding MinWidth}" Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TickBar
|
||||
x:Name="TopTick"
|
||||
Width="6"
|
||||
Fill="{DynamicResource SliderTickBarFill}"
|
||||
Fill="{DynamicResource ControlStrongFillColorDefaultBrush}"
|
||||
Placement="Left"
|
||||
SnapsToDevicePixels="True"
|
||||
Visibility="Collapsed" />
|
||||
Visibility="Collapsed"
|
||||
Width="6"
|
||||
x:Name="TopTick" />
|
||||
<Border
|
||||
x:Name="TrackBackground"
|
||||
Grid.Column="1"
|
||||
Width="4"
|
||||
Margin="0"
|
||||
Background="{DynamicResource SliderTrackFill}"
|
||||
Background="{DynamicResource ControlStrongFillColorDefaultBrush}"
|
||||
BorderThickness="0"
|
||||
CornerRadius="2" />
|
||||
CornerRadius="2"
|
||||
Grid.Column="1"
|
||||
Margin="0"
|
||||
Width="4"
|
||||
x:Name="TrackBackground" />
|
||||
|
||||
<Track x:Name="PART_Track" Grid.Column="1">
|
||||
<Track Grid.Column="1" x:Name="PART_Track">
|
||||
<Track.DecreaseRepeatButton>
|
||||
<RepeatButton Command="Slider.DecreaseLarge" Style="{StaticResource UiSliderButtonStyle}" />
|
||||
</Track.DecreaseRepeatButton>
|
||||
<Track.Thumb>
|
||||
<Thumb x:Name="Thumb" Style="{StaticResource UiSliderThumbStyle}" />
|
||||
<Thumb Style="{StaticResource UiSliderThumbStyle}" x:Name="Thumb" />
|
||||
</Track.Thumb>
|
||||
<Track.IncreaseRepeatButton>
|
||||
<RepeatButton Command="Slider.IncreaseLarge" Style="{StaticResource UiSliderButtonStyle}" />
|
||||
</Track.IncreaseRepeatButton>
|
||||
</Track>
|
||||
<TickBar
|
||||
x:Name="BottomTick"
|
||||
Fill="{DynamicResource ControlStrongFillColorDefaultBrush}"
|
||||
Grid.Column="2"
|
||||
Width="6"
|
||||
Fill="{DynamicResource SliderTickBarFill}"
|
||||
Placement="Right"
|
||||
SnapsToDevicePixels="True"
|
||||
Visibility="Collapsed" />
|
||||
Visibility="Collapsed"
|
||||
Width="6"
|
||||
x:Name="BottomTick" />
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="TickPlacement" Value="TopLeft">
|
||||
<Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
|
||||
<Setter Property="Visibility" TargetName="TopTick" Value="Visible" />
|
||||
</Trigger>
|
||||
<Trigger Property="TickPlacement" Value="BottomRight">
|
||||
<Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
|
||||
<Setter Property="Visibility" TargetName="BottomTick" Value="Visible" />
|
||||
</Trigger>
|
||||
<Trigger Property="TickPlacement" Value="Both">
|
||||
<Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
|
||||
<Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
|
||||
<Setter Property="Visibility" TargetName="TopTick" Value="Visible" />
|
||||
<Setter Property="Visibility" TargetName="BottomTick" Value="Visible" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="TrackBackground" Property="Background" Value="{DynamicResource SliderTrackFillPointerOver}" />
|
||||
<Setter TargetName="Thumb" Property="Foreground" Value="{DynamicResource SliderThumbBackgroundPointerOver}" />
|
||||
<Setter Property="Background" TargetName="TrackBackground" Value="{DynamicResource ControlStrongFillColorDefaultBrush}" />
|
||||
<Setter Property="Foreground" TargetName="Thumb" Value="{DynamicResource SystemFillColorAttentionBrush}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
Reference in New Issue
Block a user