2025-08-24 13:49:55 +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"
|
2026-02-20 15:31:44 +08:00
|
|
|
xmlns:controls="clr-namespace:Melskin.Controls">
|
2025-09-08 19:49:09 +08:00
|
|
|
<ResourceDictionary.MergedDictionaries>
|
2026-01-02 17:30:41 +08:00
|
|
|
<ResourceDictionary Source="/Melskin;component/Themes/Animations.xaml" />
|
2025-09-08 19:49:09 +08:00
|
|
|
</ResourceDictionary.MergedDictionaries>
|
2026-02-20 15:31:44 +08:00
|
|
|
<Style x:Key="ExpandCollapseToggleButtonStyle" TargetType="{x:Type ToggleButton}">
|
2025-09-08 19:49:09 +08:00
|
|
|
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
|
|
|
|
|
<Setter Property="Focusable" Value="False" />
|
|
|
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
|
|
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="ToggleButton">
|
|
|
|
|
<controls:IconElement
|
2026-02-20 15:31:44 +08:00
|
|
|
x:Name="ChevronIcon"
|
|
|
|
|
VerticalAlignment="Center"
|
2025-09-08 19:49:09 +08:00
|
|
|
FontSize="14"
|
|
|
|
|
RenderTransformOrigin="0.5,0.5"
|
2026-02-20 15:31:44 +08:00
|
|
|
Symbol="ChevronRight">
|
2025-09-08 19:49:09 +08:00
|
|
|
<controls:IconElement.RenderTransform>
|
|
|
|
|
<RotateTransform Angle="0" />
|
|
|
|
|
</controls:IconElement.RenderTransform>
|
|
|
|
|
</controls:IconElement>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<Trigger Property="IsChecked" Value="True">
|
|
|
|
|
<Trigger.EnterActions>
|
|
|
|
|
<BeginStoryboard>
|
|
|
|
|
<Storyboard>
|
|
|
|
|
<DoubleAnimation
|
|
|
|
|
Storyboard.TargetName="ChevronIcon"
|
|
|
|
|
Storyboard.TargetProperty="(Grid.RenderTransform).(RotateTransform.Angle)"
|
2026-02-20 15:31:44 +08:00
|
|
|
To="90"
|
|
|
|
|
Duration="0:0:0.16" />
|
2025-09-08 19:49:09 +08:00
|
|
|
</Storyboard>
|
|
|
|
|
</BeginStoryboard>
|
|
|
|
|
</Trigger.EnterActions>
|
|
|
|
|
<Trigger.ExitActions>
|
|
|
|
|
<BeginStoryboard>
|
|
|
|
|
<Storyboard>
|
|
|
|
|
<DoubleAnimation
|
|
|
|
|
Storyboard.TargetName="ChevronIcon"
|
|
|
|
|
Storyboard.TargetProperty="(Grid.RenderTransform).(RotateTransform.Angle)"
|
2026-02-20 15:31:44 +08:00
|
|
|
To="0"
|
|
|
|
|
Duration="0:0:0.16" />
|
2025-09-08 19:49:09 +08:00
|
|
|
</Storyboard>
|
|
|
|
|
</BeginStoryboard>
|
|
|
|
|
</Trigger.ExitActions>
|
|
|
|
|
</Trigger>
|
|
|
|
|
<!--<Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
<Setter TargetName="ChevronIcon" Property="Foreground" Value="{DynamicResource TextSecondaryBrush}" />
|
|
|
|
|
</Trigger>-->
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
2025-12-23 21:35:54 +08:00
|
|
|
|
2025-07-11 09:20:23 +08:00
|
|
|
<Style TargetType="{x:Type TreeView}">
|
2025-08-26 21:33:20 +08:00
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
2025-08-12 23:08:54 +08:00
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
|
|
|
|
|
<Setter Property="BorderThickness" Value="1" />
|
|
|
|
|
<Setter Property="Padding" Value="4" />
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
|
|
|
|
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
|
|
|
|
|
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
|
|
|
|
<Setter Property="ScrollViewer.PanningMode" Value="Both" />
|
2025-08-24 13:49:55 +08:00
|
|
|
<Setter Property="assists:ControlAssist.CornerRadius" Value="4" />
|
|
|
|
|
|
2025-08-12 23:08:54 +08:00
|
|
|
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type TreeView}">
|
2025-08-12 23:08:54 +08:00
|
|
|
<Border
|
2026-02-20 15:31:44 +08:00
|
|
|
x:Name="Bd"
|
2025-08-12 23:08:54 +08:00
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
2025-08-24 13:49:55 +08:00
|
|
|
CornerRadius="{TemplateBinding assists:ControlAssist.CornerRadius}"
|
2026-02-20 15:31:44 +08:00
|
|
|
SnapsToDevicePixels="True">
|
2025-08-12 23:08:54 +08:00
|
|
|
<ScrollViewer
|
2026-02-20 15:31:44 +08:00
|
|
|
x:Name="treeViewScroll"
|
|
|
|
|
Padding="{TemplateBinding Padding}"
|
2025-08-25 17:30:53 +08:00
|
|
|
CanContentScroll="False"
|
|
|
|
|
Focusable="False"
|
2025-08-12 23:08:54 +08:00
|
|
|
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
|
|
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
2026-02-20 15:31:44 +08:00
|
|
|
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
|
2025-08-12 23:08:54 +08:00
|
|
|
<ItemsPresenter />
|
2025-07-11 09:20:23 +08:00
|
|
|
</ScrollViewer>
|
|
|
|
|
</Border>
|
|
|
|
|
<ControlTemplate.Triggers>
|
2025-08-25 17:30:53 +08:00
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
2026-02-20 15:31:44 +08:00
|
|
|
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
</Trigger>
|
2025-08-25 17:30:53 +08:00
|
|
|
<Trigger Property="VirtualizingPanel.IsVirtualizing" Value="True">
|
2026-02-20 15:31:44 +08:00
|
|
|
<Setter TargetName="treeViewScroll" Property="CanContentScroll" Value="True" />
|
2025-07-11 09:20:23 +08:00
|
|
|
</Trigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
<Style.Triggers>
|
2025-08-25 17:30:53 +08:00
|
|
|
<Trigger Property="VirtualizingPanel.IsVirtualizing" Value="True">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="ItemsPanel">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ItemsPanelTemplate>
|
2025-08-12 23:08:54 +08:00
|
|
|
<VirtualizingStackPanel />
|
2025-07-11 09:20:23 +08:00
|
|
|
</ItemsPanelTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Trigger>
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
</Style>
|
|
|
|
|
|
2025-09-08 19:49:09 +08:00
|
|
|
|
2025-07-11 09:20:23 +08:00
|
|
|
|
|
|
|
|
<Style TargetType="{x:Type TreeViewItem}">
|
2025-08-12 23:08:54 +08:00
|
|
|
<Setter Property="Background" Value="Transparent" />
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
|
|
|
|
|
<Setter Property="Padding" Value="4" />
|
|
|
|
|
<Setter Property="FontSize" Value="14" />
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
2025-08-26 21:33:20 +08:00
|
|
|
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type TreeViewItem}">
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.RowDefinitions>
|
2025-08-12 23:08:54 +08:00
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
<RowDefinition />
|
2025-07-11 09:20:23 +08:00
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
2025-08-12 23:08:54 +08:00
|
|
|
<Border
|
2026-02-20 15:31:44 +08:00
|
|
|
x:Name="Bd"
|
2025-08-12 23:08:54 +08:00
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
|
CornerRadius="4"
|
2026-02-20 15:31:44 +08:00
|
|
|
SnapsToDevicePixels="True">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Grid>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
2025-08-12 23:08:54 +08:00
|
|
|
<ColumnDefinition Width="22" />
|
|
|
|
|
<ColumnDefinition Width="auto" />
|
|
|
|
|
<ColumnDefinition Width="*" />
|
2025-07-11 09:20:23 +08:00
|
|
|
</Grid.ColumnDefinitions>
|
2025-08-12 23:08:54 +08:00
|
|
|
<ToggleButton
|
2026-02-20 15:31:44 +08:00
|
|
|
x:Name="Expander"
|
2025-08-12 23:08:54 +08:00
|
|
|
ClickMode="Press"
|
|
|
|
|
IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}"
|
2026-02-20 15:31:44 +08:00
|
|
|
Style="{StaticResource ExpandCollapseToggleButtonStyle}" />
|
2025-08-12 23:08:54 +08:00
|
|
|
<ContentPresenter
|
2026-02-20 15:31:44 +08:00
|
|
|
x:Name="PART_Header"
|
2025-08-12 23:08:54 +08:00
|
|
|
Grid.Column="1"
|
2026-01-02 17:30:30 +08:00
|
|
|
Margin="{TemplateBinding Padding}"
|
2026-02-20 15:31:44 +08:00
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
ContentSource="Header"
|
|
|
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
</Border>
|
2025-08-12 23:08:54 +08:00
|
|
|
<!-- 子对象 -->
|
|
|
|
|
<ItemsPresenter
|
2026-02-20 15:31:44 +08:00
|
|
|
x:Name="ItemsHost"
|
2025-08-12 23:08:54 +08:00
|
|
|
Grid.Row="1"
|
2026-02-20 15:31:44 +08:00
|
|
|
Margin="16,0,0,0" />
|
2025-07-11 09:20:23 +08:00
|
|
|
</Grid>
|
|
|
|
|
<ControlTemplate.Triggers>
|
2025-08-25 17:30:53 +08:00
|
|
|
<Trigger Property="IsExpanded" Value="False">
|
2026-02-20 15:31:44 +08:00
|
|
|
<Setter TargetName="ItemsHost" Property="Visibility" Value="Collapsed" />
|
2025-07-11 09:20:23 +08:00
|
|
|
</Trigger>
|
2025-08-25 17:30:53 +08:00
|
|
|
<Trigger Property="HasItems" Value="False">
|
2026-02-20 15:31:44 +08:00
|
|
|
<Setter TargetName="Expander" Property="Visibility" Value="Hidden" />
|
2025-07-11 09:20:23 +08:00
|
|
|
</Trigger>
|
2025-08-25 17:30:53 +08:00
|
|
|
<Trigger Property="IsSelected" Value="True">
|
2026-02-20 15:31:44 +08:00
|
|
|
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
|
2025-09-12 09:55:36 +08:00
|
|
|
<!--<Setter Property="Foreground" Value="{DynamicResource TextAccentBrush}" />-->
|
2026-02-20 15:31:44 +08:00
|
|
|
<Setter TargetName="Expander" Property="Foreground" Value="{DynamicResource TextAccentBrush}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
</Trigger>
|
2025-08-20 12:10:13 +08:00
|
|
|
<Trigger Property="UIElement.IsMouseOver" Value="True">
|
2026-02-20 15:31:44 +08:00
|
|
|
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlBackgroundHoverBrush}" />
|
2025-08-20 12:10:13 +08:00
|
|
|
</Trigger>
|
2025-07-11 09:20:23 +08:00
|
|
|
<MultiTrigger>
|
|
|
|
|
<MultiTrigger.Conditions>
|
2025-08-25 17:30:53 +08:00
|
|
|
<Condition Property="IsSelected" Value="True" />
|
|
|
|
|
<Condition Property="IsSelectionActive" Value="False" />
|
2025-07-11 09:20:23 +08:00
|
|
|
</MultiTrigger.Conditions>
|
2026-02-20 15:31:44 +08:00
|
|
|
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
|
|
|
|
|
<Setter TargetName="Expander" Property="Foreground" Value="{DynamicResource TextAccentBrush}" />
|
2025-09-04 22:39:00 +08:00
|
|
|
</MultiTrigger>
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
<Condition Property="IsSelected" Value="True" />
|
|
|
|
|
<Condition Property="UIElement.IsMouseOver" Value="True" />
|
|
|
|
|
</MultiTrigger.Conditions>
|
2026-02-20 15:31:44 +08:00
|
|
|
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlBackgroundPressedBrush}" />
|
|
|
|
|
<Setter TargetName="Expander" Property="Foreground" Value="{DynamicResource TextAccentBrush}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
</MultiTrigger>
|
2025-08-25 17:30:53 +08:00
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
2025-08-12 23:08:54 +08:00
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextDisabledBrush}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
</Trigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
<Style.Triggers>
|
2025-08-25 17:30:53 +08:00
|
|
|
<Trigger Property="VirtualizingPanel.IsVirtualizing" Value="True">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="ItemsPanel">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ItemsPanelTemplate>
|
2025-08-12 23:08:54 +08:00
|
|
|
<VirtualizingStackPanel />
|
2025-07-11 09:20:23 +08:00
|
|
|
</ItemsPanelTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Trigger>
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
</Style>
|
2025-09-08 19:49:09 +08:00
|
|
|
|
2025-12-23 21:35:54 +08:00
|
|
|
|
2025-07-11 09:20:23 +08:00
|
|
|
</ResourceDictionary>
|