更新
This commit is contained in:
@@ -1,33 +1,26 @@
|
||||
<!--
|
||||
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
|
||||
<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:controls="clr-namespace:WPFluent.Controls"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<ControlTemplate x:Key="NullViewTemplate" TargetType="{x:Type controls:ListView}">
|
||||
<ControlTemplate TargetType="{x:Type controls:ListView}" x:Key="NullViewTemplate">
|
||||
<Grid>
|
||||
<controls:PassiveScrollViewer
|
||||
x:Name="PART_ContentHost"
|
||||
CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
||||
x:Name="PART_ContentHost">
|
||||
<ItemsPresenter />
|
||||
</controls:PassiveScrollViewer>
|
||||
<Rectangle
|
||||
x:Name="PART_DisabledVisual"
|
||||
Opacity="0"
|
||||
RadiusX="2"
|
||||
RadiusY="2"
|
||||
Stretch="Fill"
|
||||
Stroke="Transparent"
|
||||
StrokeThickness="0"
|
||||
Visibility="Collapsed">
|
||||
Visibility="Collapsed"
|
||||
x:Name="PART_DisabledVisual">
|
||||
<Rectangle.Fill>
|
||||
<SolidColorBrush Color="{DynamicResource ControlFillColorDefault}" />
|
||||
</Rectangle.Fill>
|
||||
@@ -38,12 +31,12 @@
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="False" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="PART_DisabledVisual" Property="Visibility" Value="Visible" />
|
||||
<Setter Property="Visibility" TargetName="PART_DisabledVisual" Value="Visible" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<ControlTemplate x:Key="GridViewScrollViewerTemplate" TargetType="ScrollViewer">
|
||||
<ControlTemplate TargetType="ScrollViewer" x:Key="GridViewScrollViewerTemplate">
|
||||
<Grid Background="Transparent">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
@@ -61,83 +54,85 @@
|
||||
VerticalScrollBarVisibility="Hidden">
|
||||
<!-- margin-left matched to listviewitem.padding -->
|
||||
<controls:GridViewHeaderRowPresenter
|
||||
Margin="4"
|
||||
AllowsColumnReorder="{Binding Path=View.AllowsColumnReorder, RelativeSource={RelativeSource AncestorType=ListView}}"
|
||||
ColumnHeaderContainerStyle="{Binding Path=View.ColumnHeaderContainerStyle, RelativeSource={RelativeSource AncestorType=ListView}}"
|
||||
ColumnHeaderContextMenu="{Binding Path=View.ColumnHeaderContextMenu, RelativeSource={RelativeSource AncestorType=ListView}}"
|
||||
ColumnHeaderTemplate="{Binding Path=View.ColumnHeaderTemplate, RelativeSource={RelativeSource AncestorType=ListView}}"
|
||||
ColumnHeaderToolTip="{Binding Path=View.ColumnHeaderToolTip, RelativeSource={RelativeSource AncestorType=ListView}}"
|
||||
Columns="{Binding Path=View.Columns, RelativeSource={RelativeSource AncestorType=ListView}}"
|
||||
Margin="4"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</ScrollViewer>
|
||||
<ScrollContentPresenter
|
||||
Name="PART_ScrollContentPresenter"
|
||||
CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
|
||||
CanHorizontallyScroll="False"
|
||||
CanVerticallyScroll="False"
|
||||
Content="{TemplateBinding ContentControl.Content}"
|
||||
ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
|
||||
KeyboardNavigation.DirectionalNavigation="Local"
|
||||
Name="PART_ScrollContentPresenter"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</DockPanel>
|
||||
<ScrollBar
|
||||
Name="PART_HorizontalScrollBar"
|
||||
Grid.Row="1"
|
||||
Cursor="Arrow"
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Maximum="{TemplateBinding ScrollViewer.ScrollableWidth}"
|
||||
Minimum="0"
|
||||
Name="PART_HorizontalScrollBar"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{TemplateBinding ScrollViewer.ComputedHorizontalScrollBarVisibility}"
|
||||
Value="{Binding Path=HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" />
|
||||
Value="{Binding Path=HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
|
||||
Visibility="{TemplateBinding ScrollViewer.ComputedHorizontalScrollBarVisibility}" />
|
||||
<ScrollBar
|
||||
Name="PART_VerticalScrollBar"
|
||||
Grid.Column="1"
|
||||
Cursor="Arrow"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Maximum="{TemplateBinding ScrollViewer.ScrollableHeight}"
|
||||
Minimum="0"
|
||||
Name="PART_VerticalScrollBar"
|
||||
Orientation="Vertical"
|
||||
Visibility="{TemplateBinding ScrollViewer.ComputedVerticalScrollBarVisibility}"
|
||||
Value="{Binding Path=VerticalOffset, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" />
|
||||
Value="{Binding Path=VerticalOffset, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
|
||||
Visibility="{TemplateBinding ScrollViewer.ComputedVerticalScrollBarVisibility}" />
|
||||
<DockPanel
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
LastChildFill="False">
|
||||
<Rectangle
|
||||
Width="1"
|
||||
DockPanel.Dock="Left"
|
||||
Fill="#FFFFFFFF"
|
||||
Visibility="{TemplateBinding ScrollViewer.ComputedVerticalScrollBarVisibility}" />
|
||||
Visibility="{TemplateBinding ScrollViewer.ComputedVerticalScrollBarVisibility}"
|
||||
Width="1" />
|
||||
<Rectangle
|
||||
Height="1"
|
||||
DockPanel.Dock="Top"
|
||||
Fill="#FFFFFFFF"
|
||||
Height="1"
|
||||
Visibility="{TemplateBinding ScrollViewer.ComputedHorizontalScrollBarVisibility}" />
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
|
||||
<ControlTemplate x:Key="GridViewTemplate" TargetType="{x:Type controls:ListView}">
|
||||
<ControlTemplate TargetType="{x:Type controls:ListView}" x:Key="GridViewTemplate">
|
||||
<Border
|
||||
Name="Bd"
|
||||
Background="Transparent"
|
||||
BorderBrush="{TemplateBinding Border.BorderBrush}"
|
||||
BorderThickness="{TemplateBinding Border.BorderThickness}">
|
||||
BorderThickness="{TemplateBinding Border.BorderThickness}"
|
||||
Name="Bd">
|
||||
<controls:PassiveScrollViewer
|
||||
Padding="{TemplateBinding Control.Padding}"
|
||||
CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
|
||||
Focusable="False"
|
||||
Padding="{TemplateBinding Control.Padding}"
|
||||
Template="{DynamicResource GridViewScrollViewerTemplate}">
|
||||
<ItemsPresenter />
|
||||
</controls:PassiveScrollViewer>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<Style x:Key="ListViewStyle" TargetType="{x:Type controls:ListView}">
|
||||
<Style TargetType="{x:Type controls:ListView}" x:Key="ListViewStyle">
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
||||
|
||||
Reference in New Issue
Block a user