整理代码
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user