From 9d1660270272180cd71147d6ddd53d1382643d2e Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 18:00:14 +0800
Subject: [PATCH] merge: 并入远程 Initial commit 作为历史根节点
---
WPFProject/Style/CommonTree.xaml | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/WPFProject/Style/CommonTree.xaml b/WPFProject/Style/CommonTree.xaml
new file mode 100644
index 0000000..0d1cb1e
--- /dev/null
+++ b/WPFProject/Style/CommonTree.xaml
@@ -0,0 +1,51 @@
+锘�<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+
+ xmlns:hc="https://handyorg.github.io/handycontrol"
+ >
+ <ResourceDictionary.MergedDictionaries>
+ <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
+ <ResourceDictionary Source="/HMI.UI;component/Style/colors.xaml"/>
+ </ResourceDictionary.MergedDictionaries>
+
+ <Style TargetType="TreeViewItem" BasedOn="{StaticResource TreeViewItemBaseStyle}">
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="TreeViewItem">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition MinHeight="{TemplateBinding MinHeight}"/>
+ <RowDefinition Height="Auto"/>
+ </Grid.RowDefinitions>
+ <Border x:Name="Bd" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
+ <DockPanel LastChildFill="True" Margin="{Binding Converter={StaticResource TreeViewItemMarginConverter}, RelativeSource={RelativeSource TemplatedParent}}">
+ <ToggleButton x:Name="Expander" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ExpandCollapseToggleStyle}"/>
+ <ContentPresenter VerticalAlignment="Center" x:Name="PART_Header" ContentSource="Header" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
+ </DockPanel>
+ </Border>
+ <ItemsPresenter Grid.Row="1" x:Name="ItemsHost" />
+ </Grid>
+ <ControlTemplate.Triggers>
+ <Trigger Property="IsMouseOver" Value="true" SourceName="Bd">
+ <Setter Property="Background" TargetName="Bd" Value="{StaticResource SecondaryImportant}"/>
+ </Trigger>
+ <Trigger Property="IsExpanded" Value="false">
+ <Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/>
+ </Trigger>
+ <Trigger Property="HasItems" Value="false">
+ <Setter Property="Visibility" TargetName="Expander" Value="Hidden"/>
+ </Trigger>
+ <Trigger Property="IsSelected" Value="true">
+ <Setter Property="Background" TargetName="Bd" Value="{StaticResource Important}"/>
+ <Setter Property="Foreground" Value="{DynamicResource TextIconBrush}"/>
+ </Trigger>
+
+ <Trigger Property="IsEnabled" Value="false">
+ <Setter Property="Opacity" Value=".4" />
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+</ResourceDictionary>
\ No newline at end of file
--
Gitblit v1.9.1