整理代码

This commit is contained in:
GG Z
2026-02-20 15:31:44 +08:00
parent 94cf3f3266
commit 9f121cfc7f
149 changed files with 4063 additions and 6964 deletions

View File

@@ -1,8 +1,8 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:assists="clr-namespace:Melskin.Assists"
xmlns:controls="clr-namespace:Melskin.Controls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:controls="clr-namespace:Melskin.Controls">
<Style TargetType="{x:Type controls:TreeGrid}">
<Setter Property="Background" Value="{DynamicResource BackgroundLayoutBrush}" />
@@ -20,11 +20,11 @@
<VisualBrush.Visual>
<!-- 定义遮罩形状:黑色代表可见区域,圆角与外部一致 -->
<Border
Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=Border}}"
Height="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType=Border}}"
Background="Black"
CornerRadius="{Binding CornerRadius, RelativeSource={RelativeSource AncestorType=Border}}"
Height="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType=Border}}"
SnapsToDevicePixels="True"
Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=Border}}" />
SnapsToDevicePixels="True" />
</VisualBrush.Visual>
</VisualBrush>
</Border.OpacityMask>
@@ -33,24 +33,24 @@
<!-- - 用 ScrollViewer 包裹以同步滚动 -->
<!-- - 隐藏自己的滚动条,因为它只是一个“跟随者” -->
<ScrollViewer
x:Name="PART_HeaderScrollViewer"
Background="Transparent"
DockPanel.Dock="Top"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Disabled"
x:Name="PART_HeaderScrollViewer">
VerticalScrollBarVisibility="Disabled">
<GridViewHeaderRowPresenter Columns="{Binding Columns, RelativeSource={RelativeSource TemplatedParent}}" />
</ScrollViewer>
<!-- 2. 内容区域,占据剩余空间 -->
<!-- - 将所有相关属性从外层 TreeGrid 传递给内部的 TreeView -->
<TreeView
x:Name="PART_ContentTreeView"
assists:ControlAssist.CornerRadius="0"
Background="{DynamicResource ControlBackgroundNormalBrush}"
BorderThickness="0"
ItemContainerStyle="{Binding ItemContainerStyle, RelativeSource={RelativeSource TemplatedParent}}"
ItemTemplate="{Binding ItemTemplate, RelativeSource={RelativeSource TemplatedParent}}"
ItemsSource="{Binding ItemsSource, RelativeSource={RelativeSource TemplatedParent}}"
assists:ControlAssist.CornerRadius="0"
x:Name="PART_ContentTreeView">
ItemsSource="{Binding ItemsSource, RelativeSource={RelativeSource TemplatedParent}}">
<!-- 可选:为了性能,可以启用虚拟化 -->
<TreeView.ItemsPanel>
<ItemsPanelTemplate>