Files

386 lines
22 KiB
Plaintext
Raw Permalink Normal View History

<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"
xmlns:controls="clr-namespace:Melskin.Controls">
<ResourceDictionary.MergedDictionaries>
2026-01-02 17:30:41 +08:00
<ResourceDictionary Source="/Melskin;component/Themes/Animations.xaml" />
</ResourceDictionary.MergedDictionaries>
2025-07-31 20:12:24 +08:00
<!-- 向下扩展 -->
2026-02-20 15:31:44 +08:00
<Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
2025-07-31 20:12:24 +08:00
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
2025-12-23 21:35:54 +08:00
<RowDefinition Height="Auto" />
2025-07-31 20:12:24 +08:00
</Grid.RowDefinitions>
<Grid Margin="{TemplateBinding Padding}" SnapsToDevicePixels="False">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="20" />
</Grid.ColumnDefinitions>
2025-12-23 21:35:54 +08:00
<ContentPresenter
Grid.Column="0"
2026-01-02 17:30:30 +08:00
Margin="4,0,0,0"
2026-02-20 15:31:44 +08:00
HorizontalAlignment="Left"
VerticalAlignment="Center"
2025-12-23 21:35:54 +08:00
RecognizesAccessKey="True"
2026-02-20 15:31:44 +08:00
SnapsToDevicePixels="True" />
<controls:IconElement
2026-02-20 15:31:44 +08:00
x:Name="arrow"
2026-01-02 17:30:30 +08:00
Grid.Column="1"
Padding="-6"
2026-02-20 15:31:44 +08:00
FontSize="28"
Foreground="{DynamicResource TextSecondaryBrush}"
RenderTransformOrigin="0.5,0.5"
2025-12-23 21:35:54 +08:00
SnapsToDevicePixels="False"
2026-02-20 15:31:44 +08:00
Symbol="KeyboardArrowDown">
<controls:IconElement.RenderTransform>
<RotateTransform Angle="0" />
</controls:IconElement.RenderTransform>
</controls:IconElement>
2025-07-31 20:12:24 +08:00
</Grid>
<Border
2026-02-20 15:31:44 +08:00
x:Name="separate"
2025-07-31 20:12:24 +08:00
Grid.Row="1"
Height="1"
2026-02-20 15:31:44 +08:00
Background="{DynamicResource DividerBrush}"
2025-07-31 20:12:24 +08:00
SnapsToDevicePixels="False"
2026-02-20 15:31:44 +08:00
Visibility="Collapsed" />
2025-07-31 20:12:24 +08:00
</Grid>
<ControlTemplate.Triggers>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsChecked" Value="True">
2026-02-20 15:31:44 +08:00
<Setter TargetName="separate" Property="Visibility" Value="Visible" />
<Trigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource ExpandRotateStoryboard}" />
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource CollapseRotateStoryboard}" />
</Trigger.ExitActions>
2025-07-31 20:12:24 +08:00
</Trigger>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsMouseOver" Value="True">
2026-02-20 15:31:44 +08:00
<Setter TargetName="arrow" Property="Foreground" Value="{DynamicResource PrimaryHoverBrush}" />
2025-07-31 20:12:24 +08:00
</Trigger>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsPressed" Value="True">
2026-02-20 15:31:44 +08:00
<Setter TargetName="arrow" Property="Foreground" Value="{DynamicResource PrimaryPressedBrush}" />
2025-07-31 20:12:24 +08:00
</Trigger>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsEnabled" Value="False">
2026-02-20 15:31:44 +08:00
<Setter TargetName="arrow" Property="Foreground" Value="{DynamicResource TextDisabledBrush}" />
2025-07-31 20:12:24 +08:00
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 向上扩展 -->
2026-02-20 15:31:44 +08:00
<Style x:Key="ExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}">
2025-07-31 20:12:24 +08:00
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid Background="Transparent">
<Grid.RowDefinitions>
2025-12-23 21:35:54 +08:00
<RowDefinition Height="Auto" />
2025-07-31 20:12:24 +08:00
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid
Grid.Row="1"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="False">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="20" />
</Grid.ColumnDefinitions>
<controls:IconElement
2026-02-20 15:31:44 +08:00
x:Name="arrow"
2026-01-02 17:30:30 +08:00
Grid.Column="1"
Padding="-6"
2026-02-20 15:31:44 +08:00
FontSize="28"
Foreground="{DynamicResource TextSecondaryBrush}"
RenderTransformOrigin="0.5,0.5"
2025-12-23 21:35:54 +08:00
SnapsToDevicePixels="False"
2026-02-20 15:31:44 +08:00
Symbol="KeyboardArrowUp">
<controls:IconElement.RenderTransform>
<RotateTransform Angle="0" />
</controls:IconElement.RenderTransform>
</controls:IconElement>
2025-07-31 20:12:24 +08:00
<ContentPresenter
Grid.Column="0"
2026-01-02 17:30:30 +08:00
Margin="4,0,0,0"
2026-02-20 15:31:44 +08:00
HorizontalAlignment="Left"
VerticalAlignment="Center"
2025-07-31 20:12:24 +08:00
RecognizesAccessKey="True"
2026-02-20 15:31:44 +08:00
SnapsToDevicePixels="True" />
2025-07-31 20:12:24 +08:00
</Grid>
<Border
2026-02-20 15:31:44 +08:00
x:Name="separate"
2025-07-31 20:12:24 +08:00
Grid.Row="0"
Height="1"
2026-02-20 15:31:44 +08:00
Background="{DynamicResource DividerBrush}"
2025-07-31 20:12:24 +08:00
SnapsToDevicePixels="False"
2026-02-20 15:31:44 +08:00
Visibility="Collapsed" />
2025-07-31 20:12:24 +08:00
</Grid>
<ControlTemplate.Triggers>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsChecked" Value="True">
2026-02-20 15:31:44 +08:00
<Setter TargetName="separate" Property="Visibility" Value="Visible" />
<Trigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource ExpandRotateStoryboard}" />
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource CollapseRotateStoryboard}" />
</Trigger.ExitActions>
2025-07-31 20:12:24 +08:00
</Trigger>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsMouseOver" Value="True">
2026-02-20 15:31:44 +08:00
<Setter TargetName="arrow" Property="Foreground" Value="{DynamicResource PrimaryHoverBrush}" />
2025-07-31 20:12:24 +08:00
</Trigger>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsPressed" Value="True">
2026-02-20 15:31:44 +08:00
<Setter TargetName="arrow" Property="Foreground" Value="{DynamicResource PrimaryPressedBrush}" />
2025-07-31 20:12:24 +08:00
</Trigger>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsEnabled" Value="False">
2026-02-20 15:31:44 +08:00
<Setter TargetName="arrow" Property="Foreground" Value="{DynamicResource TextDisabledBrush}" />
2025-07-31 20:12:24 +08:00
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 向左扩展 -->
2026-02-20 15:31:44 +08:00
<Style x:Key="ExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}">
2025-07-31 20:12:24 +08:00
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
2025-12-23 21:35:54 +08:00
<ColumnDefinition Width="Auto" />
2025-07-31 20:12:24 +08:00
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid
Grid.Column="1"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="False">
<Grid.RowDefinitions>
<RowDefinition Height="20" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<controls:IconElement
2026-02-20 15:31:44 +08:00
x:Name="arrow"
Padding="-6"
FontSize="28"
Foreground="{DynamicResource TextSecondaryBrush}"
RenderTransformOrigin="0.5,0.5"
2025-12-23 21:35:54 +08:00
SnapsToDevicePixels="False"
2026-02-20 15:31:44 +08:00
Symbol="KeyboardArrowLeft">
<controls:IconElement.RenderTransform>
<RotateTransform Angle="0" />
</controls:IconElement.RenderTransform>
</controls:IconElement>
2025-12-23 21:35:54 +08:00
2025-07-31 20:12:24 +08:00
<ContentPresenter
Grid.Row="1"
2026-01-02 17:30:30 +08:00
Margin="0,4,0,0"
2026-02-20 15:31:44 +08:00
HorizontalAlignment="Center"
VerticalAlignment="Top"
2025-07-31 20:12:24 +08:00
RecognizesAccessKey="True"
2026-02-20 15:31:44 +08:00
SnapsToDevicePixels="True">
2025-07-31 20:12:24 +08:00
<ContentPresenter.LayoutTransform>
<RotateTransform Angle="90" />
</ContentPresenter.LayoutTransform>
</ContentPresenter>
</Grid>
<Border
2026-02-20 15:31:44 +08:00
x:Name="separate"
2026-01-02 17:30:30 +08:00
Grid.Column="0"
Width="1"
2026-02-20 15:31:44 +08:00
Background="{DynamicResource DividerBrush}"
SnapsToDevicePixels="False"
Visibility="Collapsed" />
2025-07-31 20:12:24 +08:00
</Grid>
<ControlTemplate.Triggers>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsChecked" Value="True">
2026-02-20 15:31:44 +08:00
<Setter TargetName="separate" Property="Visibility" Value="Visible" />
<Trigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource ExpandRotateStoryboard}" />
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource CollapseRotateStoryboard}" />
</Trigger.ExitActions>
2025-07-31 20:12:24 +08:00
</Trigger>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsMouseOver" Value="True">
2026-02-20 15:31:44 +08:00
<Setter TargetName="arrow" Property="Foreground" Value="{DynamicResource PrimaryHoverBrush}" />
2025-07-31 20:12:24 +08:00
</Trigger>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsPressed" Value="True">
2026-02-20 15:31:44 +08:00
<Setter TargetName="arrow" Property="Foreground" Value="{DynamicResource PrimaryPressedBrush}" />
2025-07-31 20:12:24 +08:00
</Trigger>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsEnabled" Value="False">
2026-02-20 15:31:44 +08:00
<Setter TargetName="arrow" Property="Foreground" Value="{DynamicResource TextDisabledBrush}" />
2025-07-31 20:12:24 +08:00
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 向右扩展 -->
2026-02-20 15:31:44 +08:00
<Style x:Key="ExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}">
2025-07-31 20:12:24 +08:00
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
2025-12-23 21:35:54 +08:00
<ColumnDefinition Width="Auto" />
2025-07-31 20:12:24 +08:00
</Grid.ColumnDefinitions>
<Grid
Grid.Column="0"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="False">
<Grid.RowDefinitions>
<RowDefinition Height="20" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<controls:IconElement
2026-02-20 15:31:44 +08:00
x:Name="arrow"
Padding="-6"
FontSize="28"
Foreground="{DynamicResource TextSecondaryBrush}"
RenderTransformOrigin="0.5,0.5"
2025-12-23 21:35:54 +08:00
SnapsToDevicePixels="False"
2026-02-20 15:31:44 +08:00
Symbol="KeyboardArrowRight">
<controls:IconElement.RenderTransform>
<RotateTransform Angle="0" />
</controls:IconElement.RenderTransform>
</controls:IconElement>
2025-12-23 21:35:54 +08:00
2025-07-31 20:12:24 +08:00
<ContentPresenter
Grid.Row="1"
2026-01-02 17:30:30 +08:00
Margin="0,4,0,0"
2026-02-20 15:31:44 +08:00
HorizontalAlignment="Center"
VerticalAlignment="Top"
2025-07-31 20:12:24 +08:00
RecognizesAccessKey="True"
2026-02-20 15:31:44 +08:00
SnapsToDevicePixels="True">
2025-07-31 20:12:24 +08:00
<ContentPresenter.LayoutTransform>
<RotateTransform Angle="-90" />
</ContentPresenter.LayoutTransform>
</ContentPresenter>
</Grid>
<Border
2026-02-20 15:31:44 +08:00
x:Name="separate"
2026-01-02 17:30:30 +08:00
Grid.Column="1"
Width="1"
2026-02-20 15:31:44 +08:00
Background="{DynamicResource DividerBrush}"
SnapsToDevicePixels="False"
Visibility="Collapsed" />
2025-07-31 20:12:24 +08:00
</Grid>
<ControlTemplate.Triggers>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsChecked" Value="True">
2026-02-20 15:31:44 +08:00
<Setter TargetName="separate" Property="Visibility" Value="Visible" />
<Trigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource ExpandRotateStoryboard}" />
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource CollapseRotateStoryboard}" />
</Trigger.ExitActions>
2025-07-31 20:12:24 +08:00
</Trigger>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsMouseOver" Value="True">
2026-02-20 15:31:44 +08:00
<Setter TargetName="arrow" Property="Foreground" Value="{DynamicResource PrimaryHoverBrush}" />
2025-07-31 20:12:24 +08:00
</Trigger>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsPressed" Value="True">
2026-02-20 15:31:44 +08:00
<Setter TargetName="arrow" Property="Foreground" Value="{DynamicResource PrimaryPressedBrush}" />
2025-07-31 20:12:24 +08:00
</Trigger>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsEnabled" Value="False">
2026-02-20 15:31:44 +08:00
<Setter TargetName="arrow" Property="Foreground" Value="{DynamicResource TextDisabledBrush}" />
2025-07-31 20:12:24 +08:00
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type Expander}">
2025-08-12 23:08:54 +08:00
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
2025-08-26 21:33:20 +08:00
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
2025-07-31 20:12:24 +08:00
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Top" />
2025-08-12 23:08:54 +08:00
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
2025-07-31 20:12:24 +08:00
<Setter Property="FontSize" Value="14" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Margin" Value="4" />
<Setter Property="Padding" Value="4" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Expander}">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4"
2025-12-23 21:35:54 +08:00
SnapsToDevicePixels="True">
2025-07-31 20:12:24 +08:00
<DockPanel>
<ToggleButton
2026-02-20 15:31:44 +08:00
x:Name="HeaderSite"
Padding="6"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
2025-07-31 20:12:24 +08:00
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
DockPanel.Dock="Top"
2025-08-26 21:33:20 +08:00
FocusVisualStyle="{DynamicResource FocusVisual}"
2025-07-31 20:12:24 +08:00
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontStretch="{TemplateBinding FontStretch}"
FontStyle="{TemplateBinding FontStyle}"
FontWeight="{TemplateBinding FontWeight}"
Foreground="{TemplateBinding Foreground}"
IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
2026-02-20 15:31:44 +08:00
Style="{StaticResource ExpanderDownHeaderStyle}" />
2025-07-31 20:12:24 +08:00
<ContentPresenter
2026-02-20 15:31:44 +08:00
x:Name="ExpandSite"
2026-01-02 17:30:30 +08:00
Margin="{TemplateBinding Padding}"
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
DockPanel.Dock="Bottom"
Focusable="False"
Visibility="Collapsed" />
2025-07-31 20:12:24 +08:00
</DockPanel>
</Border>
<ControlTemplate.Triggers>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsExpanded" Value="True">
2026-02-20 15:31:44 +08:00
<Setter TargetName="ExpandSite" Property="Visibility" Value="Visible" />
2025-07-31 20:12:24 +08:00
</Trigger>
<Trigger Property="ExpandDirection" Value="Right">
2026-02-20 15:31:44 +08:00
<Setter TargetName="ExpandSite" Property="DockPanel.Dock" Value="Right" />
<Setter TargetName="HeaderSite" Property="DockPanel.Dock" Value="Left" />
<Setter TargetName="HeaderSite" Property="Style" Value="{StaticResource ExpanderRightHeaderStyle}" />
2025-07-31 20:12:24 +08:00
<!-- 靠左 -->
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Stretch" />
</Trigger>
<Trigger Property="ExpandDirection" Value="Up">
2026-02-20 15:31:44 +08:00
<Setter TargetName="ExpandSite" Property="DockPanel.Dock" Value="Top" />
<Setter TargetName="HeaderSite" Property="DockPanel.Dock" Value="Bottom" />
<Setter TargetName="HeaderSite" Property="Style" Value="{StaticResource ExpanderUpHeaderStyle}" />
2025-07-31 20:12:24 +08:00
<!-- 靠下 -->
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Bottom" />
</Trigger>
<Trigger Property="ExpandDirection" Value="Left">
2026-02-20 15:31:44 +08:00
<Setter TargetName="ExpandSite" Property="DockPanel.Dock" Value="Left" />
<Setter TargetName="HeaderSite" Property="DockPanel.Dock" Value="Right" />
<Setter TargetName="HeaderSite" Property="Style" Value="{StaticResource ExpanderLeftHeaderStyle}" />
2025-07-31 20:12:24 +08:00
<!-- 靠右 -->
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="VerticalAlignment" Value="Stretch" />
</Trigger>
2025-12-23 21:35:54 +08:00
<Trigger Property="IsEnabled" Value="False">
2025-08-12 23:08:54 +08:00
<Setter Property="Foreground" Value="{DynamicResource TextDisabledBrush}" />
2025-07-31 20:12:24 +08:00
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>