2025-08-20 12:10:35 +08:00
|
|
|
<ResourceDictionary
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
2026-01-02 17:30:30 +08:00
|
|
|
xmlns:assists="clr-namespace:VariaStudio.Assists"
|
|
|
|
|
xmlns:controls="clr-namespace:VariaStudio.Controls"
|
|
|
|
|
xmlns:decorations="clr-namespace:VariaStudio.Controls.Decorations"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
2025-08-20 12:10:35 +08:00
|
|
|
|
|
|
|
|
<ResourceDictionary.MergedDictionaries>
|
2026-01-02 17:30:30 +08:00
|
|
|
<ResourceDictionary Source="/VariaStudio;component/Controls/Button.xaml" />
|
2025-08-20 12:10:35 +08:00
|
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
|
|
2026-01-02 17:30:30 +08:00
|
|
|
<Style TargetType="{x:Type controls:NumberBox}" x:Key="SlotNumberBoxStyle">
|
2025-08-20 12:10:35 +08:00
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
|
2025-12-28 11:47:54 +08:00
|
|
|
<Setter Property="BorderThickness" Value="0" />
|
2025-08-20 12:10:35 +08:00
|
|
|
<Setter Property="Padding" Value="2" />
|
|
|
|
|
<Setter Property="Focusable" Value="False" />
|
2025-08-26 21:33:20 +08:00
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
2025-08-20 12:10:35 +08:00
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
2025-12-28 11:47:54 +08:00
|
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
2025-08-20 12:10:35 +08:00
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
2025-09-06 00:36:23 +08:00
|
|
|
<ControlTemplate TargetType="{x:Type controls:NumberBox}">
|
2025-08-20 12:10:35 +08:00
|
|
|
<decorations:SlotBorder
|
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
2026-01-02 17:30:30 +08:00
|
|
|
Intensity="0.2"
|
|
|
|
|
Padding="{TemplateBinding Padding}"
|
|
|
|
|
x:Name="slot">
|
2025-08-20 12:10:35 +08:00
|
|
|
<Grid>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<!-- 前缀 -->
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
<!-- 输入框 -->
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
<!-- 后缀 -->
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
2025-08-20 12:10:35 +08:00
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<ContentPresenter
|
2026-01-02 17:30:30 +08:00
|
|
|
Content="{TemplateBinding assists:InputAssist.Prefix}"
|
|
|
|
|
Focusable="False"
|
2025-08-20 12:10:35 +08:00
|
|
|
Grid.Column="0"
|
|
|
|
|
Margin="1,0,5,0"
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
2026-01-02 17:30:30 +08:00
|
|
|
x:Name="Prefix" />
|
2025-08-20 12:10:35 +08:00
|
|
|
<TextBox
|
2026-01-02 17:30:30 +08:00
|
|
|
Background="Transparent"
|
2025-08-20 12:10:35 +08:00
|
|
|
Grid.Column="1"
|
2025-12-23 21:35:54 +08:00
|
|
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
2026-01-02 17:30:30 +08:00
|
|
|
Padding="0"
|
|
|
|
|
Style="{DynamicResource FlattenTextBoxStyle}"
|
2025-08-20 12:10:35 +08:00
|
|
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
2026-01-02 17:30:30 +08:00
|
|
|
x:Name="PART_TextBox">
|
2025-08-20 12:10:35 +08:00
|
|
|
<!--<TextBox.Text>
|
|
|
|
|
<MultiBinding Converter="{StaticResource PrecisionConverter}" UpdateSourceTrigger="PropertyChanged">
|
|
|
|
|
<Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
|
|
|
|
|
<Binding Path="Precision" RelativeSource="{RelativeSource TemplatedParent}" />
|
|
|
|
|
</MultiBinding>
|
|
|
|
|
</TextBox.Text>-->
|
|
|
|
|
</TextBox>
|
2025-12-23 21:35:54 +08:00
|
|
|
<!-- Suffix -->
|
|
|
|
|
<ContentPresenter
|
2026-01-02 17:30:30 +08:00
|
|
|
Content="{TemplateBinding assists:InputAssist.Suffix}"
|
|
|
|
|
Focusable="False"
|
2025-12-23 21:35:54 +08:00
|
|
|
Grid.Column="2"
|
|
|
|
|
Margin="5,0,1,0"
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
2026-01-02 17:30:30 +08:00
|
|
|
x:Name="Suffix" />
|
2025-08-20 12:10:35 +08:00
|
|
|
<Border
|
2025-09-08 19:49:09 +08:00
|
|
|
Background="Transparent"
|
|
|
|
|
BorderBrush="{DynamicResource BorderNormalBrush}"
|
2026-01-02 17:30:30 +08:00
|
|
|
BorderThickness="1,0,0,0"
|
|
|
|
|
Grid.Column="3"
|
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
|
Margin="-2"
|
|
|
|
|
x:Name="border">
|
2025-12-28 11:47:54 +08:00
|
|
|
<Grid Width="15">
|
2025-08-20 12:10:35 +08:00
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
<RowDefinition Height="1" />
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<Button
|
2026-01-02 17:30:30 +08:00
|
|
|
FontSize="4"
|
2025-08-20 12:10:35 +08:00
|
|
|
Grid.Row="0"
|
2026-01-02 17:30:30 +08:00
|
|
|
IsTabStop="False"
|
2025-12-28 11:47:54 +08:00
|
|
|
Padding="-3"
|
2026-01-02 17:30:30 +08:00
|
|
|
Style="{DynamicResource FlattenButtonStyle}"
|
2025-08-20 12:10:35 +08:00
|
|
|
assists:ControlAssist.CornerRadius="0,4,0,0"
|
2026-01-02 17:30:30 +08:00
|
|
|
x:Name="PART_IncreaseButton">
|
2025-09-08 19:49:09 +08:00
|
|
|
<controls:IconElement
|
|
|
|
|
Foreground="{DynamicResource TextPrimaryBrush}"
|
|
|
|
|
RenderTransformOrigin="0.5,0.5"
|
|
|
|
|
SnapsToDevicePixels="false"
|
2026-01-02 17:30:30 +08:00
|
|
|
Symbol="KeyboardArrowUp"
|
|
|
|
|
x:Name="arrowUp">
|
2025-09-08 19:49:09 +08:00
|
|
|
<controls:IconElement.RenderTransform>
|
|
|
|
|
<RotateTransform Angle="0" />
|
|
|
|
|
</controls:IconElement.RenderTransform>
|
|
|
|
|
</controls:IconElement>
|
|
|
|
|
</Button>
|
2025-08-20 12:10:35 +08:00
|
|
|
<Rectangle
|
2026-01-02 17:30:30 +08:00
|
|
|
Fill="{DynamicResource BorderNormalBrush}"
|
2025-08-20 12:10:35 +08:00
|
|
|
Grid.Row="1"
|
2026-01-02 17:30:30 +08:00
|
|
|
Height="1" />
|
2025-08-20 12:10:35 +08:00
|
|
|
<Button
|
2026-01-02 17:30:30 +08:00
|
|
|
FontSize="4"
|
2025-08-20 12:10:35 +08:00
|
|
|
Grid.Row="2"
|
2026-01-02 17:30:30 +08:00
|
|
|
IsTabStop="False"
|
2025-12-28 11:47:54 +08:00
|
|
|
Padding="-3"
|
2026-01-02 17:30:30 +08:00
|
|
|
Style="{DynamicResource FlattenButtonStyle}"
|
2025-08-20 12:10:35 +08:00
|
|
|
assists:ControlAssist.CornerRadius="0,0,4,0"
|
2026-01-02 17:30:30 +08:00
|
|
|
x:Name="PART_DecreaseButton">
|
2025-09-08 19:49:09 +08:00
|
|
|
<controls:IconElement
|
|
|
|
|
Foreground="{DynamicResource TextPrimaryBrush}"
|
|
|
|
|
RenderTransformOrigin="0.5,0.5"
|
|
|
|
|
SnapsToDevicePixels="false"
|
2026-01-02 17:30:30 +08:00
|
|
|
Symbol="KeyboardArrowDown"
|
|
|
|
|
x:Name="arrowDown">
|
2025-09-08 19:49:09 +08:00
|
|
|
<controls:IconElement.RenderTransform>
|
|
|
|
|
<RotateTransform Angle="0" />
|
|
|
|
|
</controls:IconElement.RenderTransform>
|
|
|
|
|
</controls:IconElement>
|
|
|
|
|
</Button>
|
2025-08-20 12:10:35 +08:00
|
|
|
</Grid>
|
|
|
|
|
</Border>
|
2025-12-23 21:35:54 +08:00
|
|
|
|
2025-08-20 12:10:35 +08:00
|
|
|
</Grid>
|
|
|
|
|
</decorations:SlotBorder>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<!-- Prefix & Suffix -->
|
2026-01-02 17:30:30 +08:00
|
|
|
<Trigger Property="Content" SourceName="Prefix" Value="{x:Null}">
|
|
|
|
|
<Setter Property="Visibility" TargetName="Prefix" Value="Collapsed" />
|
2025-08-20 12:10:35 +08:00
|
|
|
</Trigger>
|
2026-01-02 17:30:30 +08:00
|
|
|
<Trigger Property="Content" SourceName="Suffix" Value="{x:Null}">
|
|
|
|
|
<Setter Property="Visibility" TargetName="Suffix" Value="Collapsed" />
|
2025-08-20 12:10:35 +08:00
|
|
|
</Trigger>
|
|
|
|
|
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
2025-08-25 17:30:53 +08:00
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource BorderCornerLightedGradientBrush}" />
|
2025-08-20 12:10:35 +08:00
|
|
|
<!--<Setter TargetName="border" Property="Visibility" Value="Visible"/>-->
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsKeyboardFocusWithin" Value="True">
|
2025-08-25 17:30:53 +08:00
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryFocusedBrush}" />
|
2025-08-20 12:10:35 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextDisabledBrush}" />
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="ShaderEnabled" TargetName="slot" Value="False" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</Trigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
<Style TargetType="{x:Type controls:NumberBox}">
|
|
|
|
|
<Setter Property="BorderBrush" Value="Transparent" />
|
|
|
|
|
<Setter Property="Focusable" Value="False" />
|
|
|
|
|
<Setter Property="BorderThickness" Value="1" />
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
2025-12-28 11:47:54 +08:00
|
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
2025-12-23 21:35:54 +08:00
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type controls:NumberBox}">
|
|
|
|
|
<Border
|
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
2026-01-02 17:30:30 +08:00
|
|
|
CornerRadius="{TemplateBinding assists:ControlAssist.CornerRadius}"
|
|
|
|
|
Padding="{TemplateBinding Padding}"
|
|
|
|
|
x:Name="Border">
|
2025-12-23 21:35:54 +08:00
|
|
|
<Grid>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<!-- 前缀 -->
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
<!-- 输入框 -->
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
<!-- 后缀 -->
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<ContentPresenter
|
2026-01-02 17:30:30 +08:00
|
|
|
Content="{TemplateBinding assists:InputAssist.Prefix}"
|
|
|
|
|
Focusable="False"
|
2025-12-23 21:35:54 +08:00
|
|
|
Grid.Column="0"
|
|
|
|
|
Margin="1,0,5,0"
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
2026-01-02 17:30:30 +08:00
|
|
|
x:Name="Prefix" />
|
2025-12-23 21:35:54 +08:00
|
|
|
<TextBox
|
2026-01-02 17:30:30 +08:00
|
|
|
Background="Transparent"
|
2025-12-23 21:35:54 +08:00
|
|
|
Grid.Column="1"
|
|
|
|
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
2026-01-02 17:30:30 +08:00
|
|
|
Padding="0"
|
|
|
|
|
Style="{DynamicResource FlattenTextBoxStyle}"
|
2025-12-23 21:35:54 +08:00
|
|
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
2026-01-02 17:30:30 +08:00
|
|
|
x:Name="PART_TextBox">
|
2025-12-23 21:35:54 +08:00
|
|
|
<!--<TextBox.Text>
|
|
|
|
|
<MultiBinding Converter="{StaticResource PrecisionConverter}" UpdateSourceTrigger="PropertyChanged">
|
|
|
|
|
<Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
|
|
|
|
|
<Binding Path="Precision" RelativeSource="{RelativeSource TemplatedParent}" />
|
|
|
|
|
</MultiBinding>
|
|
|
|
|
</TextBox.Text>-->
|
|
|
|
|
</TextBox>
|
|
|
|
|
<ContentPresenter
|
2026-01-02 17:30:30 +08:00
|
|
|
Content="{TemplateBinding assists:InputAssist.Suffix}"
|
|
|
|
|
Focusable="False"
|
2025-12-23 21:35:54 +08:00
|
|
|
Grid.Column="2"
|
|
|
|
|
Margin="5,0,1,0"
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
2026-01-02 17:30:30 +08:00
|
|
|
x:Name="Suffix" />
|
2025-12-23 21:35:54 +08:00
|
|
|
<Border
|
2026-01-02 17:30:30 +08:00
|
|
|
BorderBrush="{DynamicResource BorderNormalBrush}"
|
2025-12-23 21:35:54 +08:00
|
|
|
Grid.Column="3"
|
|
|
|
|
HorizontalAlignment="Right"
|
2026-01-02 17:30:30 +08:00
|
|
|
Margin="-2"
|
|
|
|
|
x:Name="border">
|
|
|
|
|
<Grid Margin="2" Width="15">
|
2025-12-23 21:35:54 +08:00
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<Button
|
|
|
|
|
Background="{DynamicResource BackgroundFloatingBrush}"
|
|
|
|
|
FontSize="4"
|
2026-01-02 17:30:30 +08:00
|
|
|
Grid.Row="0"
|
2025-12-23 21:35:54 +08:00
|
|
|
IsTabStop="False"
|
2026-01-02 17:30:30 +08:00
|
|
|
Padding="-4"
|
2025-12-23 21:35:54 +08:00
|
|
|
Style="{DynamicResource FlattenButtonStyle}"
|
2026-01-02 17:30:30 +08:00
|
|
|
Visibility="Collapsed"
|
|
|
|
|
assists:ControlAssist.CornerRadius="2,2,0,0"
|
|
|
|
|
x:Name="PART_IncreaseButton">
|
2025-12-23 21:35:54 +08:00
|
|
|
<controls:IconElement
|
|
|
|
|
Foreground="{DynamicResource TextPrimaryBrush}"
|
|
|
|
|
RenderTransformOrigin="0.5,0.5"
|
|
|
|
|
SnapsToDevicePixels="false"
|
2026-01-02 17:30:30 +08:00
|
|
|
Symbol="KeyboardArrowUp"
|
|
|
|
|
x:Name="arrowUp">
|
2025-12-23 21:35:54 +08:00
|
|
|
<controls:IconElement.RenderTransform>
|
|
|
|
|
<RotateTransform Angle="0" />
|
|
|
|
|
</controls:IconElement.RenderTransform>
|
|
|
|
|
</controls:IconElement>
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
Background="{DynamicResource BackgroundFloatingBrush}"
|
|
|
|
|
FontSize="4"
|
2026-01-02 17:30:30 +08:00
|
|
|
Grid.Row="1"
|
2025-12-23 21:35:54 +08:00
|
|
|
IsTabStop="False"
|
2026-01-02 17:30:30 +08:00
|
|
|
Padding="-4"
|
2025-12-23 21:35:54 +08:00
|
|
|
Style="{DynamicResource FlattenButtonStyle}"
|
2026-01-02 17:30:30 +08:00
|
|
|
Visibility="Collapsed"
|
|
|
|
|
assists:ControlAssist.CornerRadius="0,0,2,2"
|
|
|
|
|
x:Name="PART_DecreaseButton">
|
2025-12-23 21:35:54 +08:00
|
|
|
<controls:IconElement
|
|
|
|
|
Foreground="{DynamicResource TextPrimaryBrush}"
|
|
|
|
|
RenderTransformOrigin="0.5,0.5"
|
|
|
|
|
SnapsToDevicePixels="false"
|
2026-01-02 17:30:30 +08:00
|
|
|
Symbol="KeyboardArrowDown"
|
|
|
|
|
x:Name="arrowDown">
|
2025-12-23 21:35:54 +08:00
|
|
|
<controls:IconElement.RenderTransform>
|
|
|
|
|
<RotateTransform Angle="0" />
|
|
|
|
|
</controls:IconElement.RenderTransform>
|
|
|
|
|
</controls:IconElement>
|
|
|
|
|
</Button>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Border>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Border>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<!-- Prefix & Suffix -->
|
2026-01-02 17:30:30 +08:00
|
|
|
<Trigger Property="Content" SourceName="Prefix" Value="{x:Null}">
|
|
|
|
|
<Setter Property="Visibility" TargetName="Prefix" Value="Collapsed" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</Trigger>
|
2026-01-02 17:30:30 +08:00
|
|
|
<Trigger Property="Content" SourceName="Suffix" Value="{x:Null}">
|
|
|
|
|
<Setter Property="Visibility" TargetName="Suffix" Value="Collapsed" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</Trigger>
|
|
|
|
|
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundHoverBrush}" />
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="Visibility" TargetName="PART_IncreaseButton" Value="Visible" />
|
|
|
|
|
<Setter Property="Visibility" TargetName="PART_DecreaseButton" Value="Visible" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsKeyboardFocusWithin" Value="True">
|
|
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryNormalBrush}" />
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsFocused" Value="True">
|
|
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryNormalBrush}" />
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextDisabledBrush}" />
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
|
|
|
|
<Setter Property="Cursor" Value="None" />
|
2025-08-20 12:10:35 +08:00
|
|
|
</Trigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
</ResourceDictionary>
|