This commit is contained in:
NaBian 2023-09-24 22:58:55 +08:00
parent 8548a60193
commit 5b0be3b1ab
9 changed files with 111 additions and 246 deletions

View File

@ -104,7 +104,7 @@
<Border x:Name="Bd" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true"> <Border x:Name="Bd" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"> <hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
<hc:ToggleBlock.CheckedContent> <hc:ToggleBlock.CheckedContent>
<hc:ScrollViewer IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> <hc:ScrollViewer IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
<ItemsPresenter /> <ItemsPresenter />
</hc:ScrollViewer> </hc:ScrollViewer>
</hc:ToggleBlock.CheckedContent> </hc:ToggleBlock.CheckedContent>

View File

@ -2,68 +2,42 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="clr-namespace:HandyControl.Controls"> xmlns:hc="clr-namespace:HandyControl.Controls">
<Style x:Key="ListViewBaseStyle" <Style x:Key="ListViewBaseStyle" TargetType="ListView">
TargetType="ListView"> <Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}" />
<Setter Property="Background" <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
Value="{DynamicResource SecondaryRegionBrush}" /> <Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" <Setter Property="Padding" Value="6" />
Value="{DynamicResource BorderBrush}" /> <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="BorderThickness" <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
Value="1" /> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="Padding" <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
Value="6" /> <Setter Property="ScrollViewer.PanningMode" Value="Both" />
<Setter Property="Foreground" <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
Value="{DynamicResource PrimaryTextBrush}" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" <Setter Property="ItemContainerStyle" Value="{StaticResource ListViewItemBaseStyle}" />
Value="Auto" /> <Setter Property="hc:GridViewAttach.ColumnHeaderHeight" Value="44" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility"
Value="Auto" />
<Setter Property="ScrollViewer.CanContentScroll"
Value="true" />
<Setter Property="ScrollViewer.PanningMode"
Value="Both" />
<Setter Property="Stylus.IsFlicksEnabled"
Value="False" />
<Setter Property="VerticalContentAlignment"
Value="Center" />
<Setter Property="ItemContainerStyle"
Value="{StaticResource ListViewItemBaseStyle}" />
<Setter Property="hc:GridViewAttach.ColumnHeaderHeight"
Value="44" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="ListView"> <ControlTemplate TargetType="ListView">
<ControlTemplate.Resources> <ControlTemplate.Resources>
<Storyboard x:Key="Storyboard1"> <Storyboard x:Key="Storyboard1">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_VerticalScrollBar">
Storyboard.TargetName="PART_VerticalScrollBar"> <EasingDoubleKeyFrame KeyTime="0:0:.2" Value=".8" />
<EasingDoubleKeyFrame KeyTime="0:0:.2"
Value=".8" />
</DoubleAnimationUsingKeyFrames> </DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_HorizontalScrollBar">
Storyboard.TargetName="PART_HorizontalScrollBar"> <EasingDoubleKeyFrame KeyTime="0:0:.2" Value=".8" />
<EasingDoubleKeyFrame KeyTime="0:0:.2"
Value=".8" />
</DoubleAnimationUsingKeyFrames> </DoubleAnimationUsingKeyFrames>
</Storyboard> </Storyboard>
<Storyboard x:Key="Storyboard2"> <Storyboard x:Key="Storyboard2">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_VerticalScrollBar">
Storyboard.TargetName="PART_VerticalScrollBar"> <EasingDoubleKeyFrame KeyTime="0:0:.2" Value="0" />
<EasingDoubleKeyFrame KeyTime="0:0:.2"
Value="0" />
</DoubleAnimationUsingKeyFrames> </DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_HorizontalScrollBar">
Storyboard.TargetName="PART_HorizontalScrollBar"> <EasingDoubleKeyFrame KeyTime="0:0:.2" Value="0" />
<EasingDoubleKeyFrame KeyTime="0:0:.2"
Value="0" />
</DoubleAnimationUsingKeyFrames> </DoubleAnimationUsingKeyFrames>
</Storyboard> </Storyboard>
</ControlTemplate.Resources> </ControlTemplate.Resources>
<Border BorderBrush="{TemplateBinding BorderBrush}" <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="True">
<ScrollViewer Focusable="false"> <ScrollViewer Focusable="false">
<ScrollViewer.Template> <ScrollViewer.Template>
<ControlTemplate TargetType="ScrollViewer"> <ControlTemplate TargetType="ScrollViewer">
@ -78,55 +52,20 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<DockPanel Grid.ColumnSpan="2"> <DockPanel Grid.ColumnSpan="2">
<ScrollViewer DockPanel.Dock="Top" <ScrollViewer DockPanel.Dock="Top" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Focusable="false">
HorizontalScrollBarVisibility="Hidden" <GridViewHeaderRowPresenter AllowsColumnReorder="{Binding View.AllowsColumnReorder, RelativeSource={RelativeSource AncestorType=ListView}}" ColumnHeaderContainerStyle="{Binding View.ColumnHeaderContainerStyle, RelativeSource={RelativeSource AncestorType=ListView}}" ColumnHeaderToolTip="{Binding View.ColumnHeaderToolTip, RelativeSource={RelativeSource AncestorType=ListView}}" ColumnHeaderContextMenu="{Binding View.ColumnHeaderContextMenu, RelativeSource={RelativeSource AncestorType=ListView}}" ColumnHeaderTemplate="{Binding View.ColumnHeaderTemplate, RelativeSource={RelativeSource AncestorType=ListView}}" ColumnHeaderTemplateSelector="{Binding View.ColumnHeaderTemplateSelector, RelativeSource={RelativeSource AncestorType=ListView}}" Columns="{Binding View.Columns, RelativeSource={RelativeSource AncestorType=ListView}}" Margin="2,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
VerticalScrollBarVisibility="Hidden"
Focusable="false">
<GridViewHeaderRowPresenter AllowsColumnReorder="{Binding View.AllowsColumnReorder, RelativeSource={RelativeSource AncestorType=ListView}}"
ColumnHeaderContainerStyle="{Binding View.ColumnHeaderContainerStyle, RelativeSource={RelativeSource AncestorType=ListView}}"
ColumnHeaderToolTip="{Binding View.ColumnHeaderToolTip, RelativeSource={RelativeSource AncestorType=ListView}}"
ColumnHeaderContextMenu="{Binding View.ColumnHeaderContextMenu, RelativeSource={RelativeSource AncestorType=ListView}}"
ColumnHeaderTemplate="{Binding View.ColumnHeaderTemplate, RelativeSource={RelativeSource AncestorType=ListView}}"
ColumnHeaderTemplateSelector="{Binding View.ColumnHeaderTemplateSelector, RelativeSource={RelativeSource AncestorType=ListView}}"
Columns="{Binding View.Columns, RelativeSource={RelativeSource AncestorType=ListView}}"
Margin="2,0"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</ScrollViewer> </ScrollViewer>
</DockPanel> </DockPanel>
<hc:ToggleBlock Grid.Row="1" <hc:ToggleBlock Grid.Row="1" Grid.ColumnSpan="2" Grid.RowSpan="2" IsChecked="{Binding HasItems,RelativeSource={RelativeSource AncestorType=ListView},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
Grid.ColumnSpan="2"
Grid.RowSpan="2"
IsChecked="{Binding HasItems,RelativeSource={RelativeSource AncestorType=ListView},Mode=OneWay}"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<hc:ToggleBlock.CheckedContent> <hc:ToggleBlock.CheckedContent>
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" />
CanContentScroll="{TemplateBinding CanContentScroll}" />
</hc:ToggleBlock.CheckedContent> </hc:ToggleBlock.CheckedContent>
<hc:ToggleBlock.UnCheckedContent> <hc:ToggleBlock.UnCheckedContent>
<hc:Empty /> <hc:Empty />
</hc:ToggleBlock.UnCheckedContent> </hc:ToggleBlock.UnCheckedContent>
</hc:ToggleBlock> </hc:ToggleBlock>
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" <ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" x:Name="PART_VerticalScrollBar" Grid.Column="1" Grid.Row="1" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" />
Opacity="0" <ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" x:Name="PART_HorizontalScrollBar" Grid.Row="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" VerticalAlignment="Bottom" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}" />
x:Name="PART_VerticalScrollBar"
Grid.Column="1"
Grid.Row="1"
Maximum="{TemplateBinding ScrollableHeight}"
Orientation="Vertical"
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
ViewportSize="{TemplateBinding ViewportHeight}" />
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}"
Opacity="0"
x:Name="PART_HorizontalScrollBar"
Grid.Row="1"
Maximum="{TemplateBinding ScrollableWidth}"
Orientation="Horizontal"
VerticalAlignment="Bottom"
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
ViewportSize="{TemplateBinding ViewportWidth}" />
</Grid> </Grid>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<EventTrigger RoutedEvent="MouseEnter"> <EventTrigger RoutedEvent="MouseEnter">
@ -145,16 +84,11 @@
</Setter.Value> </Setter.Value>
</Setter> </Setter>
<Style.Triggers> <Style.Triggers>
<Trigger Property="View" <Trigger Property="View" Value="{x:Null}">
Value="{x:Null}">
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="ListView"> <ControlTemplate TargetType="ListView">
<Border BorderBrush="{TemplateBinding BorderBrush}" <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="True">
<ScrollViewer Focusable="false"> <ScrollViewer Focusable="false">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</ScrollViewer> </ScrollViewer>
@ -166,27 +100,17 @@
</Style.Triggers> </Style.Triggers>
</Style> </Style>
<Style BasedOn="{StaticResource ListViewBaseStyle}" <Style BasedOn="{StaticResource ListViewBaseStyle}" TargetType="ListView" />
TargetType="ListView" />
<Style x:Key="ListViewItemBaseStyle.Small" <Style x:Key="ListViewItemBaseStyle.Small" BasedOn="{StaticResource ListViewItemBaseStyle}" TargetType="ListViewItem">
BasedOn="{StaticResource ListViewItemBaseStyle}" <Setter Property="Padding" Value="6,2" />
TargetType="ListViewItem"> <Setter Property="MinHeight" Value="24" />
<Setter Property="Padding" <Setter Property="Margin" Value="0,0,0,2" />
Value="6,2" />
<Setter Property="MinHeight"
Value="24" />
<Setter Property="Margin"
Value="0,0,0,2" />
</Style> </Style>
<Style x:Key="ListView.Small" <Style x:Key="ListView.Small" BasedOn="{StaticResource ListViewBaseStyle}" TargetType="ListView">
BasedOn="{StaticResource ListViewBaseStyle}" <Setter Property="ItemContainerStyle" Value="{StaticResource ListViewItemBaseStyle.Small}" />
TargetType="ListView"> <Setter Property="hc:GridViewAttach.ColumnHeaderHeight" Value="30" />
<Setter Property="ItemContainerStyle"
Value="{StaticResource ListViewItemBaseStyle.Small}" />
<Setter Property="hc:GridViewAttach.ColumnHeaderHeight"
Value="30" />
</Style> </Style>
</ResourceDictionary> </ResourceDictionary>

View File

@ -602,6 +602,12 @@
<ItemsPanelTemplate x:Key="StackVerticalItemsPanelTemplate"> <ItemsPanelTemplate x:Key="StackVerticalItemsPanelTemplate">
<StackPanel FocusVisualStyle="{x:Null}" /> <StackPanel FocusVisualStyle="{x:Null}" />
</ItemsPanelTemplate> </ItemsPanelTemplate>
<ItemsPanelTemplate x:Key="VirtualizingStackHorizontalItemsPanelTemplate">
<VirtualizingStackPanel FocusVisualStyle="{x:Null}" Orientation="Horizontal" />
</ItemsPanelTemplate>
<ItemsPanelTemplate x:Key="VirtualizingStackVerticalItemsPanelTemplate">
<VirtualizingStackPanel FocusVisualStyle="{x:Null}" />
</ItemsPanelTemplate>
<ItemsPanelTemplate x:Key="WrapHorizontalItemsPanelTemplate"> <ItemsPanelTemplate x:Key="WrapHorizontalItemsPanelTemplate">
<WrapPanel FocusVisualStyle="{x:Null}" HorizontalAlignment="Center" VerticalAlignment="Center" /> <WrapPanel FocusVisualStyle="{x:Null}" HorizontalAlignment="Center" VerticalAlignment="Center" />
</ItemsPanelTemplate> </ItemsPanelTemplate>
@ -9205,7 +9211,7 @@
<Border x:Name="Bd" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true"> <Border x:Name="Bd" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"> <hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
<hc:ToggleBlock.CheckedContent> <hc:ToggleBlock.CheckedContent>
<hc:ScrollViewer IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> <hc:ScrollViewer IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
<ItemsPresenter /> <ItemsPresenter />
</hc:ScrollViewer> </hc:ScrollViewer>
</hc:ToggleBlock.CheckedContent> </hc:ToggleBlock.CheckedContent>
@ -11414,7 +11420,7 @@
<Border Grid.RowSpan="4" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"> <Border Grid.RowSpan="4" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"> <hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
<hc:ToggleBlock.CheckedContent> <hc:ToggleBlock.CheckedContent>
<hc:ScrollViewer IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> <hc:ScrollViewer IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
<ItemsPresenter /> <ItemsPresenter />
</hc:ScrollViewer> </hc:ScrollViewer>
</hc:ToggleBlock.CheckedContent> </hc:ToggleBlock.CheckedContent>
@ -11532,7 +11538,7 @@
<Border x:Name="Bd" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true"> <Border x:Name="Bd" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"> <hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
<hc:ToggleBlock.CheckedContent> <hc:ToggleBlock.CheckedContent>
<hc:ScrollViewer IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> <hc:ScrollViewer IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
<ItemsPresenter /> <ItemsPresenter />
</hc:ScrollViewer> </hc:ScrollViewer>
</hc:ToggleBlock.CheckedContent> </hc:ToggleBlock.CheckedContent>

View File

@ -17,6 +17,14 @@
<StackPanel FocusVisualStyle="{x:Null}"/> <StackPanel FocusVisualStyle="{x:Null}"/>
</ItemsPanelTemplate> </ItemsPanelTemplate>
<ItemsPanelTemplate x:Key="VirtualizingStackHorizontalItemsPanelTemplate">
<VirtualizingStackPanel FocusVisualStyle="{x:Null}" Orientation="Horizontal" />
</ItemsPanelTemplate>
<ItemsPanelTemplate x:Key="VirtualizingStackVerticalItemsPanelTemplate">
<VirtualizingStackPanel FocusVisualStyle="{x:Null}" />
</ItemsPanelTemplate>
<ItemsPanelTemplate x:Key="WrapHorizontalItemsPanelTemplate"> <ItemsPanelTemplate x:Key="WrapHorizontalItemsPanelTemplate">
<WrapPanel FocusVisualStyle="{x:Null}" HorizontalAlignment="Center" VerticalAlignment="Center"/> <WrapPanel FocusVisualStyle="{x:Null}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</ItemsPanelTemplate> </ItemsPanelTemplate>

View File

@ -79,7 +79,7 @@
<Border x:Name="Bd" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true"> <Border x:Name="Bd" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"> <hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
<hc:ToggleBlock.CheckedContent> <hc:ToggleBlock.CheckedContent>
<hc:ScrollViewer IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> <hc:ScrollViewer IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
<ItemsPresenter/> <ItemsPresenter/>
</hc:ScrollViewer> </hc:ScrollViewer>
</hc:ToggleBlock.CheckedContent> </hc:ToggleBlock.CheckedContent>

View File

@ -58,7 +58,7 @@
<Border Grid.RowSpan="4" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"> <Border Grid.RowSpan="4" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"> <hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
<hc:ToggleBlock.CheckedContent> <hc:ToggleBlock.CheckedContent>
<hc:ScrollViewer IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> <hc:ScrollViewer IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
<ItemsPresenter /> <ItemsPresenter />
</hc:ScrollViewer> </hc:ScrollViewer>
</hc:ToggleBlock.CheckedContent> </hc:ToggleBlock.CheckedContent>

View File

@ -105,7 +105,7 @@
<Border x:Name="Bd" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true"> <Border x:Name="Bd" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"> <hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
<hc:ToggleBlock.CheckedContent> <hc:ToggleBlock.CheckedContent>
<hc:ScrollViewer x:Name="_tv_scrollviewer_" IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> <hc:ScrollViewer x:Name="_tv_scrollviewer_" IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
<ItemsPresenter/> <ItemsPresenter/>
</hc:ScrollViewer> </hc:ScrollViewer>
</hc:ToggleBlock.CheckedContent> </hc:ToggleBlock.CheckedContent>

View File

@ -2,68 +2,42 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="clr-namespace:HandyControl.Controls"> xmlns:hc="clr-namespace:HandyControl.Controls">
<Style x:Key="ListViewBaseStyle" <Style x:Key="ListViewBaseStyle" TargetType="ListView">
TargetType="ListView"> <Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}" />
<Setter Property="Background" <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
Value="{DynamicResource SecondaryRegionBrush}" /> <Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" <Setter Property="Padding" Value="6" />
Value="{DynamicResource BorderBrush}" /> <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="BorderThickness" <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
Value="1" /> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="Padding" <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
Value="6" /> <Setter Property="ScrollViewer.PanningMode" Value="Both" />
<Setter Property="Foreground" <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
Value="{DynamicResource PrimaryTextBrush}" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" <Setter Property="ItemContainerStyle" Value="{StaticResource ListViewItemBaseStyle}" />
Value="Auto" /> <Setter Property="hc:GridViewAttach.ColumnHeaderHeight" Value="44" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility"
Value="Auto" />
<Setter Property="ScrollViewer.CanContentScroll"
Value="true" />
<Setter Property="ScrollViewer.PanningMode"
Value="Both" />
<Setter Property="Stylus.IsFlicksEnabled"
Value="False" />
<Setter Property="VerticalContentAlignment"
Value="Center" />
<Setter Property="ItemContainerStyle"
Value="{StaticResource ListViewItemBaseStyle}" />
<Setter Property="hc:GridViewAttach.ColumnHeaderHeight"
Value="44" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="ListView"> <ControlTemplate TargetType="ListView">
<ControlTemplate.Resources> <ControlTemplate.Resources>
<Storyboard x:Key="Storyboard1"> <Storyboard x:Key="Storyboard1">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_VerticalScrollBar">
Storyboard.TargetName="PART_VerticalScrollBar"> <EasingDoubleKeyFrame KeyTime="0:0:.2" Value=".8" />
<EasingDoubleKeyFrame KeyTime="0:0:.2"
Value=".8" />
</DoubleAnimationUsingKeyFrames> </DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_HorizontalScrollBar">
Storyboard.TargetName="PART_HorizontalScrollBar"> <EasingDoubleKeyFrame KeyTime="0:0:.2" Value=".8" />
<EasingDoubleKeyFrame KeyTime="0:0:.2"
Value=".8" />
</DoubleAnimationUsingKeyFrames> </DoubleAnimationUsingKeyFrames>
</Storyboard> </Storyboard>
<Storyboard x:Key="Storyboard2"> <Storyboard x:Key="Storyboard2">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_VerticalScrollBar">
Storyboard.TargetName="PART_VerticalScrollBar"> <EasingDoubleKeyFrame KeyTime="0:0:.2" Value="0" />
<EasingDoubleKeyFrame KeyTime="0:0:.2"
Value="0" />
</DoubleAnimationUsingKeyFrames> </DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_HorizontalScrollBar">
Storyboard.TargetName="PART_HorizontalScrollBar"> <EasingDoubleKeyFrame KeyTime="0:0:.2" Value="0" />
<EasingDoubleKeyFrame KeyTime="0:0:.2"
Value="0" />
</DoubleAnimationUsingKeyFrames> </DoubleAnimationUsingKeyFrames>
</Storyboard> </Storyboard>
</ControlTemplate.Resources> </ControlTemplate.Resources>
<Border BorderBrush="{TemplateBinding BorderBrush}" <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="True">
<ScrollViewer Focusable="false"> <ScrollViewer Focusable="false">
<ScrollViewer.Template> <ScrollViewer.Template>
<ControlTemplate TargetType="ScrollViewer"> <ControlTemplate TargetType="ScrollViewer">
@ -78,55 +52,20 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<DockPanel Grid.ColumnSpan="2"> <DockPanel Grid.ColumnSpan="2">
<ScrollViewer DockPanel.Dock="Top" <ScrollViewer DockPanel.Dock="Top" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Focusable="false">
HorizontalScrollBarVisibility="Hidden" <GridViewHeaderRowPresenter AllowsColumnReorder="{Binding View.AllowsColumnReorder, RelativeSource={RelativeSource AncestorType=ListView}}" ColumnHeaderContainerStyle="{Binding View.ColumnHeaderContainerStyle, RelativeSource={RelativeSource AncestorType=ListView}}" ColumnHeaderToolTip="{Binding View.ColumnHeaderToolTip, RelativeSource={RelativeSource AncestorType=ListView}}" ColumnHeaderContextMenu="{Binding View.ColumnHeaderContextMenu, RelativeSource={RelativeSource AncestorType=ListView}}" ColumnHeaderTemplate="{Binding View.ColumnHeaderTemplate, RelativeSource={RelativeSource AncestorType=ListView}}" ColumnHeaderTemplateSelector="{Binding View.ColumnHeaderTemplateSelector, RelativeSource={RelativeSource AncestorType=ListView}}" Columns="{Binding View.Columns, RelativeSource={RelativeSource AncestorType=ListView}}" Margin="2,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
VerticalScrollBarVisibility="Hidden"
Focusable="false">
<GridViewHeaderRowPresenter AllowsColumnReorder="{Binding View.AllowsColumnReorder, RelativeSource={RelativeSource AncestorType=ListView}}"
ColumnHeaderContainerStyle="{Binding View.ColumnHeaderContainerStyle, RelativeSource={RelativeSource AncestorType=ListView}}"
ColumnHeaderToolTip="{Binding View.ColumnHeaderToolTip, RelativeSource={RelativeSource AncestorType=ListView}}"
ColumnHeaderContextMenu="{Binding View.ColumnHeaderContextMenu, RelativeSource={RelativeSource AncestorType=ListView}}"
ColumnHeaderTemplate="{Binding View.ColumnHeaderTemplate, RelativeSource={RelativeSource AncestorType=ListView}}"
ColumnHeaderTemplateSelector="{Binding View.ColumnHeaderTemplateSelector, RelativeSource={RelativeSource AncestorType=ListView}}"
Columns="{Binding View.Columns, RelativeSource={RelativeSource AncestorType=ListView}}"
Margin="2,0"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</ScrollViewer> </ScrollViewer>
</DockPanel> </DockPanel>
<hc:ToggleBlock Grid.Row="1" <hc:ToggleBlock Grid.Row="1" Grid.ColumnSpan="2" Grid.RowSpan="2" IsChecked="{Binding HasItems,RelativeSource={RelativeSource AncestorType=ListView},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
Grid.ColumnSpan="2"
Grid.RowSpan="2"
IsChecked="{Binding HasItems,RelativeSource={RelativeSource AncestorType=ListView},Mode=OneWay}"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<hc:ToggleBlock.CheckedContent> <hc:ToggleBlock.CheckedContent>
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" />
CanContentScroll="{TemplateBinding CanContentScroll}" />
</hc:ToggleBlock.CheckedContent> </hc:ToggleBlock.CheckedContent>
<hc:ToggleBlock.UnCheckedContent> <hc:ToggleBlock.UnCheckedContent>
<hc:Empty /> <hc:Empty />
</hc:ToggleBlock.UnCheckedContent> </hc:ToggleBlock.UnCheckedContent>
</hc:ToggleBlock> </hc:ToggleBlock>
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" <ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" x:Name="PART_VerticalScrollBar" Grid.Column="1" Grid.Row="1" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" />
Opacity="0" <ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" x:Name="PART_HorizontalScrollBar" Grid.Row="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" VerticalAlignment="Bottom" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}" />
x:Name="PART_VerticalScrollBar"
Grid.Column="1"
Grid.Row="1"
Maximum="{TemplateBinding ScrollableHeight}"
Orientation="Vertical"
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
ViewportSize="{TemplateBinding ViewportHeight}" />
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}"
Opacity="0"
x:Name="PART_HorizontalScrollBar"
Grid.Row="1"
Maximum="{TemplateBinding ScrollableWidth}"
Orientation="Horizontal"
VerticalAlignment="Bottom"
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
ViewportSize="{TemplateBinding ViewportWidth}" />
</Grid> </Grid>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<EventTrigger RoutedEvent="MouseEnter"> <EventTrigger RoutedEvent="MouseEnter">
@ -147,24 +86,16 @@
<Style.Triggers> <Style.Triggers>
<MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <MultiTrigger.Conditions>
<Condition Property="IsGrouping" <Condition Property="IsGrouping" Value="true" />
Value="true" /> <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" />
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping"
Value="false" />
</MultiTrigger.Conditions> </MultiTrigger.Conditions>
<Setter Property="ScrollViewer.CanContentScroll" <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
Value="false" />
</MultiTrigger> </MultiTrigger>
<Trigger Property="View" <Trigger Property="View" Value="{x:Null}">
Value="{x:Null}">
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="ListView"> <ControlTemplate TargetType="ListView">
<Border BorderBrush="{TemplateBinding BorderBrush}" <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="True">
<ScrollViewer Focusable="false"> <ScrollViewer Focusable="false">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</ScrollViewer> </ScrollViewer>
@ -176,27 +107,17 @@
</Style.Triggers> </Style.Triggers>
</Style> </Style>
<Style BasedOn="{StaticResource ListViewBaseStyle}" <Style BasedOn="{StaticResource ListViewBaseStyle}" TargetType="ListView" />
TargetType="ListView" />
<Style x:Key="ListViewItemBaseStyle.Small" <Style x:Key="ListViewItemBaseStyle.Small" BasedOn="{StaticResource ListViewItemBaseStyle}" TargetType="ListViewItem">
BasedOn="{StaticResource ListViewItemBaseStyle}" <Setter Property="Padding" Value="6,2" />
TargetType="ListViewItem"> <Setter Property="MinHeight" Value="24" />
<Setter Property="Padding" <Setter Property="Margin" Value="0,0,0,2" />
Value="6,2" />
<Setter Property="MinHeight"
Value="24" />
<Setter Property="Margin"
Value="0,0,0,2" />
</Style> </Style>
<Style x:Key="ListView.Small" <Style x:Key="ListView.Small" BasedOn="{StaticResource ListViewBaseStyle}" TargetType="ListView">
BasedOn="{StaticResource ListViewBaseStyle}" <Setter Property="ItemContainerStyle" Value="{StaticResource ListViewItemBaseStyle.Small}" />
TargetType="ListView"> <Setter Property="hc:GridViewAttach.ColumnHeaderHeight" Value="30" />
<Setter Property="ItemContainerStyle"
Value="{StaticResource ListViewItemBaseStyle.Small}" />
<Setter Property="hc:GridViewAttach.ColumnHeaderHeight"
Value="30" />
</Style> </Style>
</ResourceDictionary> </ResourceDictionary>

View File

@ -602,6 +602,12 @@
<ItemsPanelTemplate x:Key="StackVerticalItemsPanelTemplate"> <ItemsPanelTemplate x:Key="StackVerticalItemsPanelTemplate">
<StackPanel FocusVisualStyle="{x:Null}" /> <StackPanel FocusVisualStyle="{x:Null}" />
</ItemsPanelTemplate> </ItemsPanelTemplate>
<ItemsPanelTemplate x:Key="VirtualizingStackHorizontalItemsPanelTemplate">
<VirtualizingStackPanel FocusVisualStyle="{x:Null}" Orientation="Horizontal" />
</ItemsPanelTemplate>
<ItemsPanelTemplate x:Key="VirtualizingStackVerticalItemsPanelTemplate">
<VirtualizingStackPanel FocusVisualStyle="{x:Null}" />
</ItemsPanelTemplate>
<ItemsPanelTemplate x:Key="WrapHorizontalItemsPanelTemplate"> <ItemsPanelTemplate x:Key="WrapHorizontalItemsPanelTemplate">
<WrapPanel FocusVisualStyle="{x:Null}" HorizontalAlignment="Center" VerticalAlignment="Center" /> <WrapPanel FocusVisualStyle="{x:Null}" HorizontalAlignment="Center" VerticalAlignment="Center" />
</ItemsPanelTemplate> </ItemsPanelTemplate>
@ -9324,7 +9330,7 @@
<Border x:Name="Bd" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true"> <Border x:Name="Bd" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"> <hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
<hc:ToggleBlock.CheckedContent> <hc:ToggleBlock.CheckedContent>
<hc:ScrollViewer IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> <hc:ScrollViewer IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
<ItemsPresenter /> <ItemsPresenter />
</hc:ScrollViewer> </hc:ScrollViewer>
</hc:ToggleBlock.CheckedContent> </hc:ToggleBlock.CheckedContent>
@ -11533,7 +11539,7 @@
<Border Grid.RowSpan="4" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"> <Border Grid.RowSpan="4" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"> <hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
<hc:ToggleBlock.CheckedContent> <hc:ToggleBlock.CheckedContent>
<hc:ScrollViewer IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> <hc:ScrollViewer IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
<ItemsPresenter /> <ItemsPresenter />
</hc:ScrollViewer> </hc:ScrollViewer>
</hc:ToggleBlock.CheckedContent> </hc:ToggleBlock.CheckedContent>
@ -11652,7 +11658,7 @@
<Border x:Name="Bd" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true"> <Border x:Name="Bd" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
<hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"> <hc:ToggleBlock IsChecked="{Binding HasItems,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
<hc:ToggleBlock.CheckedContent> <hc:ToggleBlock.CheckedContent>
<hc:ScrollViewer x:Name="_tv_scrollviewer_" IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> <hc:ScrollViewer x:Name="_tv_scrollviewer_" IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
<ItemsPresenter /> <ItemsPresenter />
</hc:ScrollViewer> </hc:ScrollViewer>
</hc:ToggleBlock.CheckedContent> </hc:ToggleBlock.CheckedContent>