优化更新代码,添加界面功能并整合
This commit is contained in:
87
WPFluent/Controls/TreeGrid/TreeGrid.xaml
Normal file
87
WPFluent/Controls/TreeGrid/TreeGrid.xaml
Normal file
@@ -0,0 +1,87 @@
|
||||
<!--
|
||||
This Source Code Form is subject to the terms of the MIT License.
|
||||
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
|
||||
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
|
||||
All Rights Reserved.
|
||||
-->
|
||||
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:WPFluent.Controls"
|
||||
xmlns:converters="clr-namespace:WPFluent.Converters">
|
||||
|
||||
<Style TargetType="{x:Type controls:TreeGridItem}">
|
||||
<Setter Property="Margin" Value="0" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type controls:TreeGrid}">
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="True" />
|
||||
<Setter Property="VirtualizingPanel.IsVirtualizing" Value="True" />
|
||||
<Setter Property="VirtualizingPanel.VirtualizationMode" Value="Standard" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||
<Setter Property="ItemsPanel">
|
||||
<Setter.Value>
|
||||
<ItemsPanelTemplate>
|
||||
<VirtualizingStackPanel
|
||||
IsVirtualizing="{TemplateBinding VirtualizingPanel.IsVirtualizing}"
|
||||
Orientation="Vertical"
|
||||
VirtualizationMode="{TemplateBinding VirtualizingPanel.VirtualizationMode}" />
|
||||
</ItemsPanelTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:TreeGrid}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Margin="0"
|
||||
BorderBrush="Red"
|
||||
BorderThickness="1">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition SharedSizeGroup="component" />
|
||||
<!-- Placeholders for two columns of ToggleButton -->
|
||||
<ColumnDefinition SharedSizeGroup="_toggle_group" />
|
||||
<ColumnDefinition SharedSizeGroup="_toggle_group" />
|
||||
|
||||
<ColumnDefinition SharedSizeGroup="value" />
|
||||
<ColumnDefinition SharedSizeGroup="min" />
|
||||
<ColumnDefinition SharedSizeGroup="max" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0" Text="Component" />
|
||||
<!-- Empty TreeViewItem to measure the size of its ToggleButton into the "Toggle" group -->
|
||||
<TreeViewItem Grid.Column="1" Padding="0" />
|
||||
<TextBlock Grid.Column="3" Text="Value" />
|
||||
<TextBlock Grid.Column="4" Text="Min" />
|
||||
<TextBlock Grid.Column="5" Text="Max" />
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- Header above -->
|
||||
<controls:PassiveScrollViewer
|
||||
Grid.Row="1"
|
||||
CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
|
||||
Focusable="False"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
|
||||
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
|
||||
</controls:PassiveScrollViewer>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user