Files
ShrlAlgoToolkit/WPFDark/Controls/BiaTreeListView.xaml
ShrlAlgo 4d35cadb56 更新
2025-07-11 09:20:23 +08:00

46 lines
4.0 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:WPFDark.Controls"
xmlns:wpf="clr-namespace:WPFDark">
<Style TargetType="{x:Type controls:BiaTreeListView}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:BiaTreeListView}">
<controls:BiaClippingBorder Background="{DynamicResource TextBoxBorderBrushKey}"
BorderBrush="{DynamicResource TextBoxBorderBrushKey}"
BorderThickness="1"
CornerRadius="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:BiaTreeListView}}, Path=CornerRadius, Mode=OneWay}">
<DockPanel>
<ScrollViewer x:Name="HeaderScrollViewer"
DockPanel.Dock="Top"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Disabled">
<GridViewHeaderRowPresenter HorizontalAlignment="Left" Columns="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:BiaTreeListView}}, Path=Columns, Mode=OneWay}" />
</ScrollViewer>
<controls:BiaTreeView HorizontalAlignment="Stretch"
VerticalAlignment="Top"
AlternationCount="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:BiaTreeListView}}, Path=AlternationCount, Mode=OneWay}"
BorderThickness="0"
CornerRadius="0"
IndentSize="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:BiaTreeListView}}, Path=IndentSize, Mode=OneWay}"
IsSelectionEnabled="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:BiaTreeListView}}, Path=IsSelectionEnabled, Mode=OneWay}"
IsVisibleItemExpanderButton="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:BiaTreeListView}}, Path=IsVisibleItemExpanderButton, Mode=OneWay}"
ItemContainerStyle="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:BiaTreeListView}}, Path=ItemContainerStyle, Mode=OneWay}"
ItemTemplate="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:BiaTreeListView}}, Path=ItemTemplate, Mode=OneWay}"
ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:BiaTreeListView}}, Path=ItemsSource, Mode=OneWay}"
SelectedItem="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:BiaTreeListView}}, Path=SelectedItem, Mode=OneWay}"
SelectedItems="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:BiaTreeListView}}, Path=SelectedItems, Mode=OneWay}">
<TreeView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel IsItemsHost="True" />
</ItemsPanelTemplate>
</TreeView.ItemsPanel>
</controls:BiaTreeView>
</DockPanel>
</controls:BiaClippingBorder>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>