2025-07-31 20:12:01 +08:00
|
|
|
|
<ResourceDictionary
|
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
2026-01-02 17:30:41 +08:00
|
|
|
|
xmlns:internal="clr-namespace:Melskin.Converters.Internal"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
2025-07-31 20:12:24 +08:00
|
|
|
|
<ResourceDictionary.MergedDictionaries>
|
|
|
|
|
|
<ResourceDictionary Source="RepeatButtonTransparent.xaml" />
|
|
|
|
|
|
</ResourceDictionary.MergedDictionaries>
|
2025-07-11 09:20:23 +08:00
|
|
|
|
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<!-- 滑块默认样式 -->
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<ControlTemplate TargetType="{x:Type Thumb}" x:Key="ShadowSliderThumbTemplate">
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Grid
|
|
|
|
|
|
HorizontalAlignment="Center"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
UseLayoutRounding="True"
|
|
|
|
|
|
VerticalAlignment="Center">
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Ellipse
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Fill="{DynamicResource ControlBackgroundNormalBrush}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Height="20"
|
|
|
|
|
|
StrokeThickness="1"
|
|
|
|
|
|
Width="20"
|
|
|
|
|
|
x:Name="grip">
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<Ellipse.Effect>
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<DropShadowEffect
|
|
|
|
|
|
BlurRadius="12"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Color="{DynamicResource DarkShadowColor}"
|
|
|
|
|
|
Opacity="0.4" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Ellipse.Effect>
|
|
|
|
|
|
</Ellipse>
|
|
|
|
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
2025-08-20 12:10:13 +08:00
|
|
|
|
<Trigger Property="IsMouseOver" Value="True" />
|
|
|
|
|
|
<Trigger Property="IsDragging" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Effect" TargetName="grip">
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<Setter.Value>
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<DropShadowEffect
|
|
|
|
|
|
BlurRadius="4"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Color="{DynamicResource DarkShadowColor}"
|
2025-07-31 20:12:01 +08:00
|
|
|
|
Opacity="0.6"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
ShadowDepth="3" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
</Trigger>
|
2025-08-25 17:30:53 +08:00
|
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Effect" TargetName="grip" Value="{x:Null}" />
|
|
|
|
|
|
<Setter Property="Fill" TargetName="grip" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
|
|
|
|
|
<Setter Property="Stroke" TargetName="grip" Value="{DynamicResource PrimaryDisabledBrush}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<ControlTemplate TargetType="{x:Type Slider}" x:Key="ShadowSliderVerticalTemplate">
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<Border
|
|
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
SnapsToDevicePixels="True"
|
|
|
|
|
|
x:Name="border">
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<Grid>
|
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<ColumnDefinition MinWidth="{TemplateBinding MinWidth}" Width="Auto" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
|
<RowDefinition Height="40" />
|
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
<TickBar
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Fill="{TemplateBinding Foreground}"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
Grid.Column="0"
|
|
|
|
|
|
Margin="0,0,2,0"
|
|
|
|
|
|
Placement="Left"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Visibility="Collapsed"
|
|
|
|
|
|
Width="4"
|
|
|
|
|
|
x:Name="TopTick" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<Border
|
|
|
|
|
|
BorderBrush="{DynamicResource BorderNormalBrush}"
|
|
|
|
|
|
BorderThickness="1"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
CornerRadius="4"
|
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
|
Grid.Row="0"
|
|
|
|
|
|
HorizontalAlignment="center"
|
|
|
|
|
|
Width="8"
|
|
|
|
|
|
x:Name="TrackBackground">
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<Grid>
|
|
|
|
|
|
<Border
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Background="{TemplateBinding Foreground}"
|
|
|
|
|
|
CornerRadius="4"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
Margin="-1"
|
|
|
|
|
|
VerticalAlignment="Bottom"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Width="8">
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<Border.Height>
|
|
|
|
|
|
<MultiBinding Converter="{x:Static internal:ValueToRangeWidthConverter.Instance}" ConverterParameter="1">
|
|
|
|
|
|
<Binding
|
|
|
|
|
|
Mode="OneWay"
|
|
|
|
|
|
Path="Minimum"
|
|
|
|
|
|
RelativeSource="{RelativeSource TemplatedParent}" />
|
|
|
|
|
|
<Binding
|
|
|
|
|
|
Mode="OneWay"
|
|
|
|
|
|
Path="Maximum"
|
|
|
|
|
|
RelativeSource="{RelativeSource TemplatedParent}" />
|
|
|
|
|
|
<Binding
|
|
|
|
|
|
Mode="OneWay"
|
|
|
|
|
|
Path="Value"
|
|
|
|
|
|
RelativeSource="{RelativeSource TemplatedParent}" />
|
|
|
|
|
|
<Binding
|
|
|
|
|
|
Mode="OneWay"
|
|
|
|
|
|
Path="ActualHeight"
|
|
|
|
|
|
RelativeSource="{RelativeSource AncestorType={x:Type Border}}" />
|
|
|
|
|
|
</MultiBinding>
|
|
|
|
|
|
</Border.Height>
|
|
|
|
|
|
</Border>
|
|
|
|
|
|
<Canvas Margin="-1,-6">
|
|
|
|
|
|
<Rectangle
|
|
|
|
|
|
Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Visibility="Hidden"
|
|
|
|
|
|
Width="4.0"
|
|
|
|
|
|
x:Name="PART_SelectionRange" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
</Canvas>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</Border>
|
|
|
|
|
|
<Track
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Column="1"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
Grid.Row="0"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
x:Name="PART_Track">
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<Track.DecreaseRepeatButton>
|
|
|
|
|
|
<RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource RepeatButtonTransparentStyle}" />
|
|
|
|
|
|
</Track.DecreaseRepeatButton>
|
|
|
|
|
|
<Track.IncreaseRepeatButton>
|
|
|
|
|
|
<RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource RepeatButtonTransparentStyle}" />
|
|
|
|
|
|
</Track.IncreaseRepeatButton>
|
|
|
|
|
|
<Track.Thumb>
|
|
|
|
|
|
<Thumb
|
|
|
|
|
|
Focusable="False"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Height="20"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
OverridesDefaultStyle="True"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Template="{StaticResource ShadowSliderThumbTemplate}"
|
|
|
|
|
|
VerticalAlignment="Top"
|
|
|
|
|
|
Width="22"
|
|
|
|
|
|
x:Name="Thumb" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
</Track.Thumb>
|
|
|
|
|
|
</Track>
|
|
|
|
|
|
<TickBar
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Fill="{TemplateBinding Foreground}"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
Grid.Column="2"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="0"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
Margin="2,0,0,0"
|
|
|
|
|
|
Placement="Right"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Visibility="Collapsed"
|
|
|
|
|
|
Width="4"
|
|
|
|
|
|
x:Name="BottomTick" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<!-- 新增:简单的值显示TextBlock -->
|
|
|
|
|
|
<TextBlock
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Foreground="{DynamicResource PrimaryNormalBrush}"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
Grid.Column="1"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="1"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
HorizontalAlignment="Center"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Margin="0,4,0,0"
|
|
|
|
|
|
Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, StringFormat=F1}"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
VerticalAlignment="Center"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
x:Name="ValueDisplay">
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<TextBlock.LayoutTransform>
|
|
|
|
|
|
<RotateTransform Angle="-90" />
|
|
|
|
|
|
</TextBlock.LayoutTransform>
|
|
|
|
|
|
</TextBlock>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</Border>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
|
<Trigger Property="TickPlacement" Value="TopLeft">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Margin" TargetName="TrackBackground" Value="2,5,0,5" />
|
|
|
|
|
|
<Setter Property="Visibility" TargetName="TopTick" Value="Visible" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="TickPlacement" Value="BottomRight">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Margin" TargetName="TrackBackground" Value="0,5,2,5" />
|
|
|
|
|
|
<Setter Property="Visibility" TargetName="BottomTick" Value="Visible" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="TickPlacement" Value="Both">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Visibility" TargetName="TopTick" Value="Visible" />
|
|
|
|
|
|
<Setter Property="Visibility" TargetName="BottomTick" Value="Visible" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="IsSelectionRangeEnabled" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="IsKeyboardFocused" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Foreground" TargetName="Thumb" Value="{DynamicResource PrimaryFocusedBrush}" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
<!-- 新增:可以选择是否显示值 -->
|
|
|
|
|
|
<Trigger Property="Tag" Value="HideValue">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Visibility" TargetName="ValueDisplay" Value="Collapsed" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<ControlTemplate TargetType="{x:Type Slider}" x:Key="ShadowSliderHorizontalTemplate">
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<Border
|
|
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
SnapsToDevicePixels="True"
|
|
|
|
|
|
x:Name="border">
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<Grid>
|
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
|
<RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}" />
|
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
|
<ColumnDefinition Width="40" />
|
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
<TickBar
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Fill="{TemplateBinding Foreground}"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
Grid.Row="0"
|
|
|
|
|
|
Height="4"
|
|
|
|
|
|
Margin="0,0,0,2"
|
|
|
|
|
|
Placement="Top"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Visibility="Collapsed"
|
|
|
|
|
|
x:Name="TopTick" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<Border
|
2026-01-02 17:30:30 +08:00
|
|
|
|
BorderBrush="{DynamicResource BorderNormalBrush}"
|
|
|
|
|
|
BorderThickness="1"
|
|
|
|
|
|
CornerRadius="4"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
Grid.Column="0"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="1"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
Height="8"
|
|
|
|
|
|
VerticalAlignment="center"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
x:Name="TrackBackground">
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<Grid>
|
|
|
|
|
|
<Border
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Background="{TemplateBinding Foreground}"
|
|
|
|
|
|
CornerRadius="4"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
Height="8"
|
|
|
|
|
|
HorizontalAlignment="Left"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Margin="-1">
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<Border.Width>
|
|
|
|
|
|
<MultiBinding Converter="{x:Static internal:ValueToRangeWidthConverter.Instance}" ConverterParameter="0">
|
|
|
|
|
|
<Binding
|
|
|
|
|
|
Mode="OneWay"
|
|
|
|
|
|
Path="Minimum"
|
|
|
|
|
|
RelativeSource="{RelativeSource TemplatedParent}" />
|
|
|
|
|
|
<Binding
|
|
|
|
|
|
Mode="OneWay"
|
|
|
|
|
|
Path="Maximum"
|
|
|
|
|
|
RelativeSource="{RelativeSource TemplatedParent}" />
|
|
|
|
|
|
<Binding
|
|
|
|
|
|
Mode="OneWay"
|
|
|
|
|
|
Path="Value"
|
|
|
|
|
|
RelativeSource="{RelativeSource TemplatedParent}" />
|
|
|
|
|
|
<Binding
|
|
|
|
|
|
Mode="OneWay"
|
|
|
|
|
|
Path="ActualWidth"
|
|
|
|
|
|
RelativeSource="{RelativeSource AncestorType={x:Type Border}}" />
|
|
|
|
|
|
</MultiBinding>
|
|
|
|
|
|
</Border.Width>
|
|
|
|
|
|
</Border>
|
|
|
|
|
|
<Canvas Margin="-6,-1">
|
|
|
|
|
|
<Rectangle
|
|
|
|
|
|
Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Height="4.0"
|
|
|
|
|
|
Visibility="Hidden"
|
|
|
|
|
|
x:Name="PART_SelectionRange" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
</Canvas>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
|
|
</Border>
|
|
|
|
|
|
<Track
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Column="0"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
Grid.Row="1"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
x:Name="PART_Track">
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<Track.DecreaseRepeatButton>
|
|
|
|
|
|
<RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource RepeatButtonTransparentStyle}" />
|
|
|
|
|
|
</Track.DecreaseRepeatButton>
|
|
|
|
|
|
<Track.IncreaseRepeatButton>
|
|
|
|
|
|
<RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource RepeatButtonTransparentStyle}" />
|
|
|
|
|
|
</Track.IncreaseRepeatButton>
|
|
|
|
|
|
<Track.Thumb>
|
|
|
|
|
|
<Thumb
|
|
|
|
|
|
Focusable="False"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Height="22"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
OverridesDefaultStyle="True"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Template="{StaticResource ShadowSliderThumbTemplate}"
|
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
|
Width="20"
|
|
|
|
|
|
x:Name="Thumb" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
</Track.Thumb>
|
|
|
|
|
|
</Track>
|
|
|
|
|
|
<TickBar
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Fill="{TemplateBinding Foreground}"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
Grid.Column="0"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="2"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
Height="4"
|
|
|
|
|
|
Margin="0,2,0,0"
|
|
|
|
|
|
Placement="Bottom"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Visibility="Collapsed"
|
|
|
|
|
|
x:Name="BottomTick" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<!-- 新增:简单的值显示TextBlock,放在滑块下方 -->
|
|
|
|
|
|
<TextBlock
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Foreground="{DynamicResource PrimaryNormalBrush}"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
Grid.Column="1"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="1"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
HorizontalAlignment="Center"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Margin="4,0,0,0"
|
|
|
|
|
|
Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, StringFormat=F1}"
|
2025-12-28 11:47:54 +08:00
|
|
|
|
VerticalAlignment="Center"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
x:Name="ValueDisplay" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
</Grid>
|
|
|
|
|
|
</Border>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
|
<Trigger Property="TickPlacement" Value="TopLeft">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Margin" TargetName="TrackBackground" Value="5,2,5,0" />
|
|
|
|
|
|
<Setter Property="Visibility" TargetName="TopTick" Value="Visible" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="TickPlacement" Value="BottomRight">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Margin" TargetName="TrackBackground" Value="5,0,5,2" />
|
|
|
|
|
|
<Setter Property="Visibility" TargetName="BottomTick" Value="Visible" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="TickPlacement" Value="Both">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Visibility" TargetName="TopTick" Value="Visible" />
|
|
|
|
|
|
<Setter Property="Visibility" TargetName="BottomTick" Value="Visible" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="IsSelectionRangeEnabled" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="IsKeyboardFocused" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Foreground" TargetName="Thumb" Value="{DynamicResource PrimaryFocusedBrush}" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Style TargetType="{x:Type Slider}" x:Key="ShadowSliderStyle">
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<Setter Property="Background" Value="Transparent" />
|
|
|
|
|
|
<Setter Property="BorderBrush" Value="Transparent" />
|
|
|
|
|
|
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
|
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryGradientBrush}" />
|
|
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
|
|
|
|
|
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="False" />
|
|
|
|
|
|
<Setter Property="Template" Value="{StaticResource ShadowSliderHorizontalTemplate}" />
|
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
|
<Trigger Property="Orientation" Value="Vertical">
|
|
|
|
|
|
<Setter Property="Template" Value="{StaticResource ShadowSliderVerticalTemplate}" />
|
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Stretch" />
|
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
<!-- 触发器:当IsEnabled属性为False时,设置前景色为灰色 -->
|
|
|
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryDisabledBrush}" />
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
|
<Condition Property="TickPlacement" Value="TopLeft" />
|
|
|
|
|
|
</MultiTrigger.Conditions>
|
|
|
|
|
|
<Setter Property="IsSnapToTickEnabled" Value="True" />
|
|
|
|
|
|
</MultiTrigger>
|
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
|
<Condition Property="TickPlacement" Value="BottomRight" />
|
|
|
|
|
|
</MultiTrigger.Conditions>
|
|
|
|
|
|
<Setter Property="IsSnapToTickEnabled" Value="True" />
|
|
|
|
|
|
</MultiTrigger>
|
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
|
<Condition Property="TickPlacement" Value="Both" />
|
|
|
|
|
|
</MultiTrigger.Conditions>
|
|
|
|
|
|
<Setter Property="IsSnapToTickEnabled" Value="True" />
|
|
|
|
|
|
</MultiTrigger>
|
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<ControlTemplate TargetType="{x:Type Thumb}" x:Key="DefaultSliderThumbTemplate">
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<Grid
|
|
|
|
|
|
HorizontalAlignment="Center"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
UseLayoutRounding="True"
|
|
|
|
|
|
VerticalAlignment="Center">
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<Ellipse
|
|
|
|
|
|
Fill="{DynamicResource ControlBackgroundNormalBrush}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Height="15"
|
|
|
|
|
|
StrokeThickness="1"
|
|
|
|
|
|
Width="15"
|
|
|
|
|
|
x:Name="grip">
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<!--<Ellipse.Effect>
|
|
|
|
|
|
<DropShadowEffect
|
|
|
|
|
|
BlurRadius="12"
|
|
|
|
|
|
Opacity="0.4"
|
|
|
|
|
|
Color="{DynamicResource DarkShadowColor}" />
|
|
|
|
|
|
</Ellipse.Effect>-->
|
|
|
|
|
|
</Ellipse>
|
|
|
|
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True" />
|
|
|
|
|
|
<Trigger Property="IsDragging" Value="True">
|
|
|
|
|
|
<!--<Setter TargetName="grip" Property="Effect">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<DropShadowEffect
|
|
|
|
|
|
BlurRadius="4"
|
|
|
|
|
|
Opacity="0.6"
|
|
|
|
|
|
ShadowDepth="3"
|
|
|
|
|
|
Color="{DynamicResource DarkShadowColor}" />
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>-->
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Effect" TargetName="grip" Value="{x:Null}" />
|
|
|
|
|
|
<Setter Property="Fill" TargetName="grip" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
|
|
|
|
|
<Setter Property="Stroke" TargetName="grip" Value="{DynamicResource PrimaryDisabledBrush}" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
2025-07-11 09:20:23 +08:00
|
|
|
|
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<!-- 轨道垂直默认样式 -->
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<ControlTemplate TargetType="{x:Type Slider}" x:Key="SliderVerticalTemplate">
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Border
|
|
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
SnapsToDevicePixels="True"
|
|
|
|
|
|
x:Name="border">
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<Grid>
|
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<ColumnDefinition MinWidth="{TemplateBinding MinWidth}" Width="Auto" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
|
</Grid.ColumnDefinitions>
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
|
<RowDefinition Height="40" />
|
|
|
|
|
|
</Grid.RowDefinitions>
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<TickBar
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Fill="{TemplateBinding Foreground}"
|
2025-07-31 20:12:01 +08:00
|
|
|
|
Grid.Column="0"
|
2025-09-08 19:49:09 +08:00
|
|
|
|
Margin="0,0,2,0"
|
|
|
|
|
|
Placement="Left"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Visibility="Collapsed"
|
|
|
|
|
|
Width="4"
|
|
|
|
|
|
x:Name="TopTick" />
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Border
|
2025-12-23 21:35:54 +08:00
|
|
|
|
BorderBrush="{DynamicResource BorderNormalBrush}"
|
|
|
|
|
|
BorderThickness="1"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
CornerRadius="4"
|
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
|
Grid.Row="0"
|
|
|
|
|
|
HorizontalAlignment="center"
|
|
|
|
|
|
Width="8"
|
|
|
|
|
|
x:Name="TrackBackground">
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<Grid>
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Border
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Background="{TemplateBinding Foreground}"
|
|
|
|
|
|
CornerRadius="4"
|
2025-07-31 20:12:01 +08:00
|
|
|
|
Margin="-1"
|
|
|
|
|
|
VerticalAlignment="Bottom"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Width="8">
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<Border.Height>
|
2025-08-20 12:10:13 +08:00
|
|
|
|
<MultiBinding Converter="{x:Static internal:ValueToRangeWidthConverter.Instance}" ConverterParameter="1">
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Binding
|
|
|
|
|
|
Mode="OneWay"
|
|
|
|
|
|
Path="Minimum"
|
|
|
|
|
|
RelativeSource="{RelativeSource TemplatedParent}" />
|
|
|
|
|
|
<Binding
|
|
|
|
|
|
Mode="OneWay"
|
|
|
|
|
|
Path="Maximum"
|
|
|
|
|
|
RelativeSource="{RelativeSource TemplatedParent}" />
|
|
|
|
|
|
<Binding
|
|
|
|
|
|
Mode="OneWay"
|
|
|
|
|
|
Path="Value"
|
|
|
|
|
|
RelativeSource="{RelativeSource TemplatedParent}" />
|
|
|
|
|
|
<Binding
|
|
|
|
|
|
Mode="OneWay"
|
|
|
|
|
|
Path="ActualHeight"
|
|
|
|
|
|
RelativeSource="{RelativeSource AncestorType={x:Type Border}}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</MultiBinding>
|
|
|
|
|
|
</Border.Height>
|
|
|
|
|
|
</Border>
|
|
|
|
|
|
<Canvas Margin="-1,-6">
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Rectangle
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Visibility="Hidden"
|
|
|
|
|
|
Width="4.0"
|
|
|
|
|
|
x:Name="PART_SelectionRange" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Canvas>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</Border>
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<Track
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Column="1"
|
2025-10-10 11:19:58 +08:00
|
|
|
|
Grid.Row="0"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
x:Name="PART_Track">
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<Track.DecreaseRepeatButton>
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource RepeatButtonTransparentStyle}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Track.DecreaseRepeatButton>
|
|
|
|
|
|
<Track.IncreaseRepeatButton>
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource RepeatButtonTransparentStyle}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Track.IncreaseRepeatButton>
|
|
|
|
|
|
<Track.Thumb>
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Thumb
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Focusable="False"
|
|
|
|
|
|
OverridesDefaultStyle="True"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Template="{StaticResource DefaultSliderThumbTemplate}"
|
|
|
|
|
|
VerticalAlignment="Top"
|
|
|
|
|
|
x:Name="Thumb" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Track.Thumb>
|
|
|
|
|
|
</Track>
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<TickBar
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Fill="{TemplateBinding Foreground}"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Grid.Column="2"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="0"
|
2025-09-08 19:49:09 +08:00
|
|
|
|
Margin="2,0,0,0"
|
|
|
|
|
|
Placement="Right"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Visibility="Collapsed"
|
|
|
|
|
|
Width="4"
|
|
|
|
|
|
x:Name="BottomTick" />
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<!-- 新增:简单的值显示TextBlock -->
|
|
|
|
|
|
<TextBlock
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Foreground="{DynamicResource PrimaryNormalBrush}"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Grid.Column="1"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="1"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
HorizontalAlignment="Center"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Margin="0,4,0,0"
|
|
|
|
|
|
Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, StringFormat=F1}"
|
2025-09-08 19:49:09 +08:00
|
|
|
|
VerticalAlignment="Center"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
x:Name="ValueDisplay">
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<TextBlock.LayoutTransform>
|
|
|
|
|
|
<RotateTransform Angle="-90" />
|
|
|
|
|
|
</TextBlock.LayoutTransform>
|
|
|
|
|
|
</TextBlock>
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Grid>
|
|
|
|
|
|
</Border>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
|
<Trigger Property="TickPlacement" Value="TopLeft">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Margin" TargetName="TrackBackground" Value="2,5,0,5" />
|
|
|
|
|
|
<Setter Property="Visibility" TargetName="TopTick" Value="Visible" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="TickPlacement" Value="BottomRight">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Margin" TargetName="TrackBackground" Value="0,5,2,5" />
|
|
|
|
|
|
<Setter Property="Visibility" TargetName="BottomTick" Value="Visible" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="TickPlacement" Value="Both">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Visibility" TargetName="TopTick" Value="Visible" />
|
|
|
|
|
|
<Setter Property="Visibility" TargetName="BottomTick" Value="Visible" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Trigger>
|
2025-08-20 12:10:13 +08:00
|
|
|
|
<Trigger Property="IsSelectionRangeEnabled" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Trigger>
|
2025-08-20 12:10:13 +08:00
|
|
|
|
<Trigger Property="IsKeyboardFocused" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Foreground" TargetName="Thumb" Value="{DynamicResource PrimaryFocusedBrush}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Trigger>
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<!-- 新增:可以选择是否显示值 -->
|
|
|
|
|
|
<Trigger Property="Tag" Value="HideValue">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Visibility" TargetName="ValueDisplay" Value="Collapsed" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<!-- 轨道水平默认样式 -->
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<ControlTemplate TargetType="{x:Type Slider}" x:Key="SliderHorizontalTemplate">
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Border
|
|
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
SnapsToDevicePixels="True"
|
|
|
|
|
|
x:Name="border">
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<Grid>
|
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
|
<RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}" />
|
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
|
</Grid.RowDefinitions>
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
|
<ColumnDefinition Width="40" />
|
|
|
|
|
|
</Grid.ColumnDefinitions>
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<TickBar
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Fill="{TemplateBinding Foreground}"
|
2025-07-31 20:12:01 +08:00
|
|
|
|
Grid.Row="0"
|
|
|
|
|
|
Height="4"
|
|
|
|
|
|
Margin="0,0,0,2"
|
2025-09-08 19:49:09 +08:00
|
|
|
|
Placement="Top"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Visibility="Collapsed"
|
|
|
|
|
|
x:Name="TopTick" />
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Border
|
2026-01-02 17:30:30 +08:00
|
|
|
|
BorderBrush="{DynamicResource BorderNormalBrush}"
|
|
|
|
|
|
BorderThickness="1"
|
|
|
|
|
|
CornerRadius="4"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Grid.Column="0"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="1"
|
2025-07-31 20:12:01 +08:00
|
|
|
|
Height="8"
|
|
|
|
|
|
VerticalAlignment="center"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
x:Name="TrackBackground">
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<Grid>
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Border
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Background="{TemplateBinding Foreground}"
|
|
|
|
|
|
CornerRadius="4"
|
2025-07-31 20:12:01 +08:00
|
|
|
|
Height="8"
|
|
|
|
|
|
HorizontalAlignment="Left"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Margin="-1">
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<Border.Width>
|
2025-08-20 12:10:13 +08:00
|
|
|
|
<MultiBinding Converter="{x:Static internal:ValueToRangeWidthConverter.Instance}" ConverterParameter="0">
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Binding
|
|
|
|
|
|
Mode="OneWay"
|
|
|
|
|
|
Path="Minimum"
|
|
|
|
|
|
RelativeSource="{RelativeSource TemplatedParent}" />
|
|
|
|
|
|
<Binding
|
|
|
|
|
|
Mode="OneWay"
|
|
|
|
|
|
Path="Maximum"
|
|
|
|
|
|
RelativeSource="{RelativeSource TemplatedParent}" />
|
|
|
|
|
|
<Binding
|
|
|
|
|
|
Mode="OneWay"
|
|
|
|
|
|
Path="Value"
|
|
|
|
|
|
RelativeSource="{RelativeSource TemplatedParent}" />
|
|
|
|
|
|
<Binding
|
|
|
|
|
|
Mode="OneWay"
|
|
|
|
|
|
Path="ActualWidth"
|
|
|
|
|
|
RelativeSource="{RelativeSource AncestorType={x:Type Border}}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</MultiBinding>
|
|
|
|
|
|
</Border.Width>
|
|
|
|
|
|
</Border>
|
|
|
|
|
|
<Canvas Margin="-6,-1">
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Rectangle
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Height="4.0"
|
|
|
|
|
|
Visibility="Hidden"
|
|
|
|
|
|
x:Name="PART_SelectionRange" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Canvas>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
|
|
</Border>
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<Track
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Column="0"
|
2025-10-10 11:19:58 +08:00
|
|
|
|
Grid.Row="1"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
x:Name="PART_Track">
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<Track.DecreaseRepeatButton>
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource RepeatButtonTransparentStyle}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Track.DecreaseRepeatButton>
|
|
|
|
|
|
<Track.IncreaseRepeatButton>
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource RepeatButtonTransparentStyle}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Track.IncreaseRepeatButton>
|
|
|
|
|
|
<Track.Thumb>
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Thumb
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Focusable="False"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Height="22"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
OverridesDefaultStyle="True"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Template="{StaticResource DefaultSliderThumbTemplate}"
|
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
|
Width="20"
|
|
|
|
|
|
x:Name="Thumb" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Track.Thumb>
|
|
|
|
|
|
</Track>
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<TickBar
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Fill="{TemplateBinding Foreground}"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Grid.Column="0"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="2"
|
2025-09-08 19:49:09 +08:00
|
|
|
|
Height="4"
|
|
|
|
|
|
Margin="0,2,0,0"
|
|
|
|
|
|
Placement="Bottom"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Visibility="Collapsed"
|
|
|
|
|
|
x:Name="BottomTick" />
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<!-- 新增:简单的值显示TextBlock,放在滑块下方 -->
|
|
|
|
|
|
<TextBlock
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Foreground="{DynamicResource PrimaryNormalBrush}"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Grid.Column="1"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="1"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
HorizontalAlignment="Center"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Margin="4,0,0,0"
|
|
|
|
|
|
Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, StringFormat=F1}"
|
2025-09-08 19:49:09 +08:00
|
|
|
|
VerticalAlignment="Center"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
x:Name="ValueDisplay" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Grid>
|
|
|
|
|
|
</Border>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
|
<Trigger Property="TickPlacement" Value="TopLeft">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Margin" TargetName="TrackBackground" Value="5,2,5,0" />
|
|
|
|
|
|
<Setter Property="Visibility" TargetName="TopTick" Value="Visible" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="TickPlacement" Value="BottomRight">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Margin" TargetName="TrackBackground" Value="5,0,5,2" />
|
|
|
|
|
|
<Setter Property="Visibility" TargetName="BottomTick" Value="Visible" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="TickPlacement" Value="Both">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Visibility" TargetName="TopTick" Value="Visible" />
|
|
|
|
|
|
<Setter Property="Visibility" TargetName="BottomTick" Value="Visible" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Trigger>
|
2025-08-20 12:10:13 +08:00
|
|
|
|
<Trigger Property="IsSelectionRangeEnabled" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Trigger>
|
2025-08-20 12:10:13 +08:00
|
|
|
|
<Trigger Property="IsKeyboardFocused" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Foreground" TargetName="Thumb" Value="{DynamicResource PrimaryFocusedBrush}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
|
|
|
|
|
|
|
<Style TargetType="{x:Type Slider}">
|
|
|
|
|
|
<Setter Property="Background" Value="Transparent" />
|
|
|
|
|
|
<Setter Property="BorderBrush" Value="Transparent" />
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryGradientBrush}" />
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
|
|
|
|
|
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="False" />
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<Setter Property="Template" Value="{StaticResource SliderHorizontalTemplate}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<Style.Triggers>
|
|
|
|
|
|
<Trigger Property="Orientation" Value="Vertical">
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<Setter Property="Template" Value="{StaticResource SliderVerticalTemplate}" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Setter Property="VerticalAlignment" Value="Stretch" />
|
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Trigger>
|
2025-08-25 17:30:53 +08:00
|
|
|
|
<!-- 触发器:当IsEnabled属性为False时,设置前景色为灰色 -->
|
|
|
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
2025-08-20 12:10:13 +08:00
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryDisabledBrush}" />
|
|
|
|
|
|
</Trigger>
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<MultiTrigger>
|
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
|
<Condition Property="TickPlacement" Value="TopLeft" />
|
|
|
|
|
|
</MultiTrigger.Conditions>
|
|
|
|
|
|
<Setter Property="IsSnapToTickEnabled" Value="True" />
|
|
|
|
|
|
</MultiTrigger>
|
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
|
<Condition Property="TickPlacement" Value="BottomRight" />
|
|
|
|
|
|
</MultiTrigger.Conditions>
|
|
|
|
|
|
<Setter Property="IsSnapToTickEnabled" Value="True" />
|
|
|
|
|
|
</MultiTrigger>
|
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
|
<Condition Property="TickPlacement" Value="Both" />
|
|
|
|
|
|
</MultiTrigger.Conditions>
|
|
|
|
|
|
<Setter Property="IsSnapToTickEnabled" Value="True" />
|
|
|
|
|
|
</MultiTrigger>
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Style.Triggers>
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
|
|
</ResourceDictionary>
|