2025-07-31 20:12:01 +08:00
|
|
|
|
<ResourceDictionary
|
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
2026-01-02 17:30:41 +08:00
|
|
|
|
xmlns:assists="clr-namespace:Melskin.Assists"
|
|
|
|
|
|
xmlns:decorations="clr-namespace:Melskin.Controls.Decorations"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
xmlns:effects="clr-namespace:Melskin.Effects">
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<ResourceDictionary.MergedDictionaries>
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<ResourceDictionary Source="Calendar.xaml" />
|
2026-01-02 17:30:41 +08:00
|
|
|
|
<ResourceDictionary Source="/Melskin;component/Themes/Animations.xaml" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
|
|
|
2026-02-20 15:31:44 +08:00
|
|
|
|
<Style x:Key="SlotTextBoxDatePickerStyle" TargetType="{x:Type DatePickerTextBox}">
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
2025-08-25 17:30:53 +08:00
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
2025-08-20 12:10:13 +08:00
|
|
|
|
<Setter Property="Padding" Value="3" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
|
|
|
|
|
|
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
|
|
|
|
|
|
<Setter Property="FontSize" Value="14" />
|
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<ControlTemplate TargetType="{x:Type DatePickerTextBox}">
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<!--<ControlTemplate.Resources>
|
|
|
|
|
|
-->
|
|
|
|
|
|
<!-- 聚焦对象 -->
|
|
|
|
|
|
<!--
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<Storyboard x:Key="TextBox.FocusEffect">
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<DoubleAnimation
|
|
|
|
|
|
Duration="0:0:0.2"
|
|
|
|
|
|
Storyboard.TargetName="Border"
|
|
|
|
|
|
Storyboard.TargetProperty="Intensity"
|
|
|
|
|
|
To="0.5" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Storyboard>
|
2025-09-08 19:49:09 +08:00
|
|
|
|
-->
|
|
|
|
|
|
<!-- 取消聚焦对象 -->
|
|
|
|
|
|
<!--
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<Storyboard x:Key="TextBox.LeaveEffect">
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<DoubleAnimation
|
|
|
|
|
|
Duration="0:0:0.2"
|
|
|
|
|
|
Storyboard.TargetName="Border"
|
|
|
|
|
|
Storyboard.TargetProperty="Intensity"
|
|
|
|
|
|
To="0.2" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Storyboard>
|
2025-09-08 19:49:09 +08:00
|
|
|
|
</ControlTemplate.Resources>-->
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<Grid>
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Grid>
|
2025-09-06 00:36:23 +08:00
|
|
|
|
<decorations:SlotBorder
|
2026-02-20 15:31:44 +08:00
|
|
|
|
x:Name="slot"
|
|
|
|
|
|
Padding="{TemplateBinding Padding}"
|
2025-07-31 20:12:01 +08:00
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Intensity="0.4">
|
2025-07-31 20:12:01 +08:00
|
|
|
|
|
|
|
|
|
|
<ContentControl
|
2026-02-20 15:31:44 +08:00
|
|
|
|
x:Name="PART_Watermark"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Margin="5,0,0,0"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Focusable="False"
|
|
|
|
|
|
IsHitTestVisible="False"
|
|
|
|
|
|
Opacity="0" />
|
2025-07-31 20:12:01 +08:00
|
|
|
|
|
2025-09-06 00:36:23 +08:00
|
|
|
|
</decorations:SlotBorder>
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<ScrollViewer
|
2026-02-20 15:31:44 +08:00
|
|
|
|
x:Name="PART_ContentHost"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Margin="6,0,0,0"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
2025-07-31 20:12:01 +08:00
|
|
|
|
</Grid>
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<VisualStateManager.VisualStateGroups>
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<!-- 占位符显示 -->
|
2025-08-20 12:10:13 +08:00
|
|
|
|
<!-- https://learn.microsoft.com/en-us/dotnet/desktop/wpf/controls/datepicker-styles-and-templates -->
|
|
|
|
|
|
<!-- DataPicker自带有这个状态,所以可以直接生效 -->
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<VisualStateGroup x:Name="WatermarkStates">
|
|
|
|
|
|
<VisualStateGroup.Transitions>
|
|
|
|
|
|
<VisualTransition GeneratedDuration="0" />
|
|
|
|
|
|
</VisualStateGroup.Transitions>
|
|
|
|
|
|
<VisualState x:Name="Unwatermarked" />
|
|
|
|
|
|
<VisualState x:Name="Watermarked">
|
|
|
|
|
|
<Storyboard>
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<DoubleAnimation
|
|
|
|
|
|
Storyboard.TargetName="PART_Watermark"
|
|
|
|
|
|
Storyboard.TargetProperty="Opacity"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
To="1"
|
|
|
|
|
|
Duration="0" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Storyboard>
|
|
|
|
|
|
</VisualState>
|
|
|
|
|
|
</VisualStateGroup>
|
|
|
|
|
|
</VisualStateManager.VisualStateGroups>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
|
<Condition Property="IsMouseOver" Value="false" />
|
|
|
|
|
|
<Condition Property="IsKeyboardFocused" Value="false" />
|
|
|
|
|
|
</MultiTrigger.Conditions>
|
|
|
|
|
|
<MultiTrigger.EnterActions>
|
|
|
|
|
|
<BeginStoryboard Storyboard="{StaticResource TextBox.LeaveEffect}" />
|
|
|
|
|
|
</MultiTrigger.EnterActions>
|
|
|
|
|
|
<MultiTrigger.ExitActions>
|
|
|
|
|
|
<BeginStoryboard Storyboard="{StaticResource TextBox.FocusEffect}" />
|
|
|
|
|
|
</MultiTrigger.ExitActions>
|
|
|
|
|
|
</MultiTrigger>
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
2026-02-20 15:31:44 +08:00
|
|
|
|
<Style x:Key="DefaultTextBoxDatePickerStyle" TargetType="{x:Type DatePickerTextBox}">
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<Setter Property="Background" Value="{DynamicResource BackgroundFloatingBrush}" />
|
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
|
|
|
|
|
|
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
|
|
|
|
|
|
<Setter Property="FontSize" Value="14" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
|
<Setter.Value>
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<ControlTemplate TargetType="{x:Type DatePickerTextBox}">
|
2025-08-20 12:10:13 +08:00
|
|
|
|
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Grid>
|
|
|
|
|
|
<Grid>
|
|
|
|
|
|
<Border
|
2026-02-20 15:31:44 +08:00
|
|
|
|
x:Name="Border"
|
|
|
|
|
|
Padding="{TemplateBinding Padding}"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
CornerRadius="{TemplateBinding assists:ControlAssist.CornerRadius}">
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<ContentControl
|
2026-02-20 15:31:44 +08:00
|
|
|
|
x:Name="PART_Watermark"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Margin="5,0,0,0"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Focusable="False"
|
|
|
|
|
|
IsHitTestVisible="False"
|
|
|
|
|
|
Opacity="0" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
</Border>
|
|
|
|
|
|
<ScrollViewer
|
2026-02-20 15:31:44 +08:00
|
|
|
|
x:Name="PART_ContentHost"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Margin="4,0,0,0"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
</Grid>
|
|
|
|
|
|
<VisualStateManager.VisualStateGroups>
|
|
|
|
|
|
<!-- 占位符显示 -->
|
|
|
|
|
|
<!-- https://learn.microsoft.com/en-us/dotnet/desktop/wpf/controls/datepicker-styles-and-templates -->
|
|
|
|
|
|
<!-- DataPicker自带有这个状态,所以可以直接生效 -->
|
|
|
|
|
|
<VisualStateGroup x:Name="WatermarkStates">
|
|
|
|
|
|
<VisualStateGroup.Transitions>
|
|
|
|
|
|
<VisualTransition GeneratedDuration="0" />
|
|
|
|
|
|
</VisualStateGroup.Transitions>
|
|
|
|
|
|
<VisualState x:Name="Unwatermarked" />
|
|
|
|
|
|
<VisualState x:Name="Watermarked">
|
|
|
|
|
|
<Storyboard>
|
|
|
|
|
|
<DoubleAnimation
|
|
|
|
|
|
Storyboard.TargetName="PART_Watermark"
|
|
|
|
|
|
Storyboard.TargetProperty="Opacity"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
To="1"
|
|
|
|
|
|
Duration="0" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
</Storyboard>
|
|
|
|
|
|
</VisualState>
|
|
|
|
|
|
</VisualStateGroup>
|
|
|
|
|
|
</VisualStateManager.VisualStateGroups>
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Grid>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Trigger Property="IsFocused" Value="True">
|
2026-02-20 15:31:44 +08:00
|
|
|
|
<Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource PrimaryNormalBrush}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
2026-02-20 15:31:44 +08:00
|
|
|
|
<Setter TargetName="Border" Property="Background" Value="{DynamicResource ControlBackgroundHoverBrush}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<!--<Style BasedOn="{StaticResource DefaultTextBoxDatePickerStyle}" TargetType="{x:Type DatePickerTextBox}" />-->
|
|
|
|
|
|
|
2026-02-20 15:31:44 +08:00
|
|
|
|
<ControlTemplate x:Key="SlotTemplate" TargetType="{x:Type DatePicker}">
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<ControlTemplate.Resources>
|
2026-02-20 15:31:44 +08:00
|
|
|
|
<Style x:Key="CalendarPickerButton" TargetType="{x:Type Button}">
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<ControlTemplate TargetType="{x:Type Button}">
|
|
|
|
|
|
<Grid x:Name="IconBox">
|
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
|
<RowDefinition Height="2*" />
|
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
<Border
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Grid.Row="0"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Background="{DynamicResource PrimaryGradientBrush}"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
CornerRadius="3,3,0,0" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Border
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Grid.Row="1"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Background="{DynamicResource BackgroundFloatingBrush}"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
CornerRadius="0,0,3,3" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<TextBlock
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Grid.Row="0"
|
|
|
|
|
|
HorizontalAlignment="Center"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
FontSize="8"
|
|
|
|
|
|
FontWeight="ExtraBold"
|
|
|
|
|
|
Foreground="{DynamicResource BackgroundFloatingBrush}"
|
|
|
|
|
|
Text="TEN" />
|
|
|
|
|
|
<TextBlock
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="1"
|
|
|
|
|
|
HorizontalAlignment="Center"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
|
|
FontWeight="ExtraBold"
|
|
|
|
|
|
Foreground="{DynamicResource TextSecondaryBrush}"
|
|
|
|
|
|
Text="18" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Grid.Effect>
|
|
|
|
|
|
<DropShadowEffect
|
|
|
|
|
|
BlurRadius="4"
|
|
|
|
|
|
Opacity="0.6"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
ShadowDepth="1"
|
|
|
|
|
|
Color="{DynamicResource DarkShadowColor}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
</Grid.Effect>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
|
<Setter Property="Effect">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<effects:BrightnessContrastEffect Brightness="0.08" />
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
2026-02-20 15:31:44 +08:00
|
|
|
|
<Setter TargetName="IconBox" Property="Effect">
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<DropShadowEffect
|
|
|
|
|
|
BlurRadius="4"
|
|
|
|
|
|
Opacity="0.4"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
ShadowDepth="1"
|
|
|
|
|
|
Color="{DynamicResource DarkShadowColor}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="IsPressed" Value="True">
|
|
|
|
|
|
<Setter Property="Effect">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<effects:BrightnessContrastEffect Brightness="0.06" />
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
|
|
</ControlTemplate.Resources>
|
|
|
|
|
|
<Grid
|
2026-02-20 15:31:44 +08:00
|
|
|
|
x:Name="PART_Root"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Margin="{TemplateBinding Padding}"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
SnapsToDevicePixels="True">
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<DatePickerTextBox
|
2026-02-20 15:31:44 +08:00
|
|
|
|
x:Name="PART_TextBox"
|
|
|
|
|
|
Grid.Row="0"
|
|
|
|
|
|
Grid.Column="0"
|
|
|
|
|
|
HorizontalContentAlignment="Left"
|
|
|
|
|
|
VerticalContentAlignment="Center"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
|
|
Focusable="{TemplateBinding Focusable}"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Style="{StaticResource SlotTextBoxDatePickerStyle}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Border
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Width="40"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
HorizontalAlignment="Right"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Background="Transparent" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Button
|
2026-02-20 15:31:44 +08:00
|
|
|
|
x:Name="PART_Button"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Width="28"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Margin="5"
|
|
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
|
|
Style="{StaticResource CalendarPickerButton}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- Disabled Mask -->
|
|
|
|
|
|
<Border
|
2026-02-20 15:31:44 +08:00
|
|
|
|
x:Name="DisabledMask"
|
|
|
|
|
|
Margin="4"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Background="{DynamicResource ControlBackgroundDisabledBrush}"
|
|
|
|
|
|
CornerRadius="4"
|
|
|
|
|
|
IsHitTestVisible="False"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Opacity="0" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Popup
|
2026-02-20 15:31:44 +08:00
|
|
|
|
x:Name="PART_Popup"
|
|
|
|
|
|
assists:BehaviorAssist.SimulateNativeBehavior="True"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
AllowsTransparency="True"
|
|
|
|
|
|
Placement="Bottom"
|
|
|
|
|
|
PlacementTarget="{Binding ElementName=PART_Button}"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
StaysOpen="True" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
</Grid>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
2026-02-20 15:31:44 +08:00
|
|
|
|
<Setter TargetName="DisabledMask" Property="Opacity" Value="0.6" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
<DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="false">
|
2026-02-20 15:31:44 +08:00
|
|
|
|
<Setter TargetName="PART_TextBox" Property="Foreground" Value="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
</DataTrigger>
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
|
|
2026-02-20 15:31:44 +08:00
|
|
|
|
<ControlTemplate x:Key="DefaultTemplate" TargetType="{x:Type DatePicker}">
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<ControlTemplate.Resources>
|
2026-02-20 15:31:44 +08:00
|
|
|
|
<Style x:Key="CalendarPickerButton" TargetType="{x:Type Button}">
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<ControlTemplate TargetType="{x:Type Button}">
|
|
|
|
|
|
<Grid x:Name="IconBox">
|
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
|
<RowDefinition Height="2*" />
|
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
<Border
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Grid.Row="0"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Background="{DynamicResource PrimaryGradientBrush}"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
CornerRadius="3,3,0,0" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Border
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Grid.Row="1"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Background="{DynamicResource BackgroundFloatingBrush}"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
CornerRadius="0,0,3,3" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<TextBlock
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Grid.Row="0"
|
|
|
|
|
|
HorizontalAlignment="Center"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
FontSize="8"
|
|
|
|
|
|
FontWeight="ExtraBold"
|
|
|
|
|
|
Foreground="{DynamicResource BackgroundFloatingBrush}"
|
|
|
|
|
|
Text="TEN" />
|
|
|
|
|
|
<TextBlock
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="1"
|
|
|
|
|
|
HorizontalAlignment="Center"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
|
|
FontWeight="ExtraBold"
|
|
|
|
|
|
Foreground="{DynamicResource TextSecondaryBrush}"
|
|
|
|
|
|
Text="18" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
</Grid>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
|
<Setter Property="Effect">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<effects:BrightnessContrastEffect Brightness="0.08" />
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="IsPressed" Value="True">
|
|
|
|
|
|
<Setter Property="Effect">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<effects:BrightnessContrastEffect Brightness="0.06" />
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
</ControlTemplate.Resources>
|
|
|
|
|
|
<Grid
|
2026-02-20 15:31:44 +08:00
|
|
|
|
x:Name="PART_Root"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
SnapsToDevicePixels="True">
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<DatePickerTextBox
|
2026-02-20 15:31:44 +08:00
|
|
|
|
x:Name="PART_TextBox"
|
|
|
|
|
|
Grid.Row="0"
|
|
|
|
|
|
Grid.Column="0"
|
|
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
|
|
HorizontalContentAlignment="Left"
|
|
|
|
|
|
VerticalContentAlignment="Center"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
|
|
Focusable="{TemplateBinding Focusable}"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Style="{StaticResource DefaultTextBoxDatePickerStyle}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Border
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Width="40"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
HorizontalAlignment="Right"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Background="Transparent" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Button
|
2026-02-20 15:31:44 +08:00
|
|
|
|
x:Name="PART_Button"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Width="28"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Margin="5"
|
|
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
|
|
Style="{StaticResource CalendarPickerButton}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- Disabled Mask -->
|
|
|
|
|
|
<Border
|
2026-02-20 15:31:44 +08:00
|
|
|
|
x:Name="DisabledMask"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Background="{DynamicResource ControlBackgroundDisabledBrush}"
|
|
|
|
|
|
CornerRadius="4"
|
|
|
|
|
|
IsHitTestVisible="False"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
Opacity="0" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Popup
|
2026-02-20 15:31:44 +08:00
|
|
|
|
x:Name="PART_Popup"
|
|
|
|
|
|
assists:BehaviorAssist.SimulateNativeBehavior="True"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
AllowsTransparency="True"
|
|
|
|
|
|
Placement="Bottom"
|
|
|
|
|
|
PlacementTarget="{Binding ElementName=PART_Button}"
|
2026-02-20 15:31:44 +08:00
|
|
|
|
StaysOpen="True" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
</Grid>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
2026-02-20 15:31:44 +08:00
|
|
|
|
<Setter TargetName="DisabledMask" Property="Opacity" Value="0.6" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
<DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="false">
|
2026-02-20 15:31:44 +08:00
|
|
|
|
<Setter TargetName="PART_TextBox" Property="Foreground" Value="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
</DataTrigger>
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
|
<!-- 日期图标按钮 -->
|
2026-02-20 15:31:44 +08:00
|
|
|
|
<Style x:Key="SlotDatePicker" TargetType="{x:Type DatePicker}">
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
|
|
|
|
|
<Setter Property="IsTodayHighlighted" Value="True" />
|
|
|
|
|
|
<Setter Property="SelectedDateFormat" Value="Short" />
|
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
|
|
|
|
|
<Setter Property="Padding" Value="0" />
|
|
|
|
|
|
<!--<Setter Property="Margin" Value="0"/>-->
|
2025-12-28 11:47:54 +08:00
|
|
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Setter Property="CalendarStyle" Value="{StaticResource DefaultCalendarPickerStyle}" />
|
|
|
|
|
|
<Setter Property="MinWidth" Value="150" />
|
|
|
|
|
|
<Setter Property="BorderBrush" Value="Transparent" />
|
|
|
|
|
|
<Setter Property="BorderThickness" Value="1" />
|
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
|
|
|
|
|
<Setter Property="Template" Value="{StaticResource SlotTemplate}" />
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
<Style TargetType="{x:Type DatePicker}">
|
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
|
|
|
|
|
<Setter Property="IsTodayHighlighted" Value="True" />
|
|
|
|
|
|
<Setter Property="SelectedDateFormat" Value="Short" />
|
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
|
|
|
|
|
<Setter Property="CalendarStyle" Value="{StaticResource DefaultCalendarPickerStyle}" />
|
|
|
|
|
|
<Setter Property="MinWidth" Value="150" />
|
|
|
|
|
|
<Setter Property="BorderBrush" Value="Transparent" />
|
2026-01-01 10:02:59 +08:00
|
|
|
|
<Setter Property="BorderThickness" Value="0" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
|
|
|
|
|
<Setter Property="Template" Value="{StaticResource DefaultTemplate}" />
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
2025-07-11 09:20:23 +08:00
|
|
|
|
</ResourceDictionary>
|