489 lines
26 KiB
Plaintext
489 lines
26 KiB
Plaintext
|
|
<ResourceDictionary
|
||
|
|
x:Class="WPFDark.StandardControls.ScrollViewerEventHandler"
|
||
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||
|
|
xmlns:standardControls="clr-namespace:WPFDark.StandardControls"
|
||
|
|
xmlns:wpf="clr-namespace:WPFDark"
|
||
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||
|
|
<Style TargetType="{x:Type Thumb}" x:Key="ScrollBarTrackThumbStyle">
|
||
|
|
<Setter Property="Template">
|
||
|
|
<Setter.Value>
|
||
|
|
<ControlTemplate TargetType="{x:Type Thumb}">
|
||
|
|
<Rectangle
|
||
|
|
Fill="{TemplateBinding Background}"
|
||
|
|
Height="Auto"
|
||
|
|
HorizontalAlignment="Center"
|
||
|
|
RadiusX="4.0"
|
||
|
|
RadiusY="4.0"
|
||
|
|
SnapsToDevicePixels="True"
|
||
|
|
VerticalAlignment="Stretch"
|
||
|
|
Width="8.0"
|
||
|
|
x:Name="ScrollBarThumb" />
|
||
|
|
|
||
|
|
<ControlTemplate.Triggers>
|
||
|
|
<Trigger Property="Tag" Value="Horizontal">
|
||
|
|
<Setter Property="Width" TargetName="ScrollBarThumb" Value="Auto" />
|
||
|
|
<Setter Property="Height" TargetName="ScrollBarThumb" Value="8.0" />
|
||
|
|
<Setter Property="HorizontalAlignment" TargetName="ScrollBarThumb" Value="Stretch" />
|
||
|
|
<Setter Property="VerticalAlignment" TargetName="ScrollBarThumb" Value="Center" />
|
||
|
|
</Trigger>
|
||
|
|
</ControlTemplate.Triggers>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
</Style>
|
||
|
|
|
||
|
|
<Style TargetType="{x:Type ScrollBar}" x:Key="ThumbOnlyScrollBarStyle">
|
||
|
|
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
|
||
|
|
<Setter Property="Foreground" Value="#ABABAB" />
|
||
|
|
<Setter Property="Background" Value="{x:Null}" />
|
||
|
|
<Setter Property="MinWidth" Value="0.0" />
|
||
|
|
<Setter Property="MinHeight" Value="0.0" />
|
||
|
|
<Setter Property="Template">
|
||
|
|
<Setter.Value>
|
||
|
|
<ControlTemplate TargetType="{x:Type ScrollBar}">
|
||
|
|
<Border Background="{TemplateBinding Background}" x:Name="Root">
|
||
|
|
<Track
|
||
|
|
Focusable="False"
|
||
|
|
IsDirectionReversed="True"
|
||
|
|
x:Name="PART_Track">
|
||
|
|
|
||
|
|
<Track.Thumb>
|
||
|
|
<Thumb
|
||
|
|
Background="{TemplateBinding Foreground}"
|
||
|
|
Style="{StaticResource ScrollBarTrackThumbStyle}"
|
||
|
|
x:Name="Thumb" />
|
||
|
|
</Track.Thumb>
|
||
|
|
</Track>
|
||
|
|
</Border>
|
||
|
|
|
||
|
|
<ControlTemplate.Triggers>
|
||
|
|
<Trigger Property="Orientation" Value="Horizontal">
|
||
|
|
<Setter Property="LayoutTransform" TargetName="Root">
|
||
|
|
<Setter.Value>
|
||
|
|
<RotateTransform Angle="-90" />
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
|
||
|
|
<Setter Property="LayoutTransform" TargetName="PART_Track">
|
||
|
|
<Setter.Value>
|
||
|
|
<RotateTransform Angle="-90" />
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
|
||
|
|
<Setter Property="Tag" TargetName="Thumb" Value="Horizontal" />
|
||
|
|
</Trigger>
|
||
|
|
</ControlTemplate.Triggers>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
|
||
|
|
<Style.Triggers>
|
||
|
|
<Trigger Property="IsEnabled" Value="False">
|
||
|
|
<Setter Property="Opacity" Value="0.1" />
|
||
|
|
</Trigger>
|
||
|
|
</Style.Triggers>
|
||
|
|
</Style>
|
||
|
|
|
||
|
|
<Style TargetType="{x:Type ScrollBar}" x:Key="ThumbOnlyMouseOverScrollBarStyle">
|
||
|
|
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
|
||
|
|
<Setter Property="Foreground" Value="#ABABAB" />
|
||
|
|
<Setter Property="Background" Value="{x:Null}" />
|
||
|
|
<Setter Property="Template">
|
||
|
|
<Setter.Value>
|
||
|
|
<ControlTemplate TargetType="{x:Type ScrollBar}">
|
||
|
|
<Border Background="{TemplateBinding Background}" x:Name="Root">
|
||
|
|
<Track
|
||
|
|
Focusable="False"
|
||
|
|
IsDirectionReversed="True"
|
||
|
|
x:Name="PART_Track">
|
||
|
|
|
||
|
|
<Track.Thumb>
|
||
|
|
<Thumb
|
||
|
|
Background="{TemplateBinding Foreground}"
|
||
|
|
Style="{StaticResource ScrollBarTrackThumbStyle}"
|
||
|
|
x:Name="Thumb" />
|
||
|
|
</Track.Thumb>
|
||
|
|
</Track>
|
||
|
|
</Border>
|
||
|
|
|
||
|
|
<ControlTemplate.Triggers>
|
||
|
|
<Trigger Property="Orientation" Value="Horizontal">
|
||
|
|
<Setter Property="LayoutTransform" TargetName="Root">
|
||
|
|
<Setter.Value>
|
||
|
|
<RotateTransform Angle="-90" />
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
|
||
|
|
<Setter Property="LayoutTransform" TargetName="PART_Track">
|
||
|
|
<Setter.Value>
|
||
|
|
<RotateTransform Angle="-90" />
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
|
||
|
|
<Setter Property="Tag" TargetName="Thumb" Value="Horizontal" />
|
||
|
|
</Trigger>
|
||
|
|
</ControlTemplate.Triggers>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
|
||
|
|
<Style.Triggers>
|
||
|
|
<Trigger Property="IsMouseOver" Value="True">
|
||
|
|
<Setter Property="Opacity" Value="0.9" />
|
||
|
|
</Trigger>
|
||
|
|
<Trigger Property="IsMouseOver" Value="False">
|
||
|
|
<Setter Property="Opacity" Value="0.4" />
|
||
|
|
</Trigger>
|
||
|
|
<Trigger Property="IsEnabled" Value="False">
|
||
|
|
<Setter Property="Opacity" Value="0.1" />
|
||
|
|
</Trigger>
|
||
|
|
</Style.Triggers>
|
||
|
|
</Style>
|
||
|
|
|
||
|
|
<Style TargetType="{x:Type ScrollBar}">
|
||
|
|
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
|
||
|
|
<Setter Property="Foreground" Value="#ABABAB" />
|
||
|
|
<Setter Property="Background" Value="{x:Null}" />
|
||
|
|
<Setter Property="Template">
|
||
|
|
<Setter.Value>
|
||
|
|
<ControlTemplate TargetType="{x:Type ScrollBar}">
|
||
|
|
<Border Background="{TemplateBinding Background}" x:Name="Root">
|
||
|
|
<Track
|
||
|
|
Focusable="False"
|
||
|
|
IsDirectionReversed="True"
|
||
|
|
x:Name="PART_Track">
|
||
|
|
|
||
|
|
<Track.DecreaseRepeatButton>
|
||
|
|
<RepeatButton Background="Transparent" x:Name="PageDecButton" />
|
||
|
|
</Track.DecreaseRepeatButton>
|
||
|
|
|
||
|
|
<Track.Thumb>
|
||
|
|
<Thumb
|
||
|
|
Background="{TemplateBinding Foreground}"
|
||
|
|
Style="{StaticResource ScrollBarTrackThumbStyle}"
|
||
|
|
x:Name="Thumb" />
|
||
|
|
</Track.Thumb>
|
||
|
|
|
||
|
|
<Track.IncreaseRepeatButton>
|
||
|
|
<RepeatButton Background="Transparent" x:Name="PageIncButton" />
|
||
|
|
</Track.IncreaseRepeatButton>
|
||
|
|
</Track>
|
||
|
|
</Border>
|
||
|
|
|
||
|
|
<ControlTemplate.Triggers>
|
||
|
|
<Trigger Property="Orientation" Value="Vertical">
|
||
|
|
<Setter Property="Command" TargetName="PageDecButton" Value="ScrollBar.PageUpCommand" />
|
||
|
|
<Setter Property="Command" TargetName="PageIncButton" Value="ScrollBar.PageDownCommand" />
|
||
|
|
</Trigger>
|
||
|
|
|
||
|
|
<Trigger Property="Orientation" Value="Horizontal">
|
||
|
|
<Setter Property="Command" TargetName="PageDecButton" Value="ScrollBar.PageLeftCommand" />
|
||
|
|
<Setter Property="Command" TargetName="PageIncButton" Value="ScrollBar.PageRightCommand" />
|
||
|
|
|
||
|
|
<Setter Property="LayoutTransform" TargetName="Root">
|
||
|
|
<Setter.Value>
|
||
|
|
<RotateTransform Angle="-90" />
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
|
||
|
|
<Setter Property="LayoutTransform" TargetName="PART_Track">
|
||
|
|
<Setter.Value>
|
||
|
|
<RotateTransform Angle="-90" />
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
|
||
|
|
<Setter Property="Tag" TargetName="Thumb" Value="Horizontal" />
|
||
|
|
</Trigger>
|
||
|
|
</ControlTemplate.Triggers>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
|
||
|
|
<Style.Triggers>
|
||
|
|
<Trigger Property="IsMouseOver" Value="True">
|
||
|
|
<Setter Property="Opacity" Value="0.9" />
|
||
|
|
</Trigger>
|
||
|
|
<Trigger Property="IsMouseOver" Value="False">
|
||
|
|
<Setter Property="Opacity" Value="0.4" />
|
||
|
|
</Trigger>
|
||
|
|
<Trigger Property="IsEnabled" Value="False">
|
||
|
|
<Setter Property="Opacity" Value="0.1" />
|
||
|
|
</Trigger>
|
||
|
|
</Style.Triggers>
|
||
|
|
</Style>
|
||
|
|
|
||
|
|
<Style TargetType="{x:Type ScrollViewer}" x:Key="DefaultScrollViewerStyle">
|
||
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||
|
|
<Setter Property="Template">
|
||
|
|
<Setter.Value>
|
||
|
|
<ControlTemplate TargetType="{x:Type ScrollViewer}">
|
||
|
|
<Grid
|
||
|
|
Background="Transparent"
|
||
|
|
MouseLeave="OnMouseLeave"
|
||
|
|
PreviewMouseMove="OnPreviewMouseMove">
|
||
|
|
<ScrollContentPresenter CanContentScroll="{TemplateBinding CanContentScroll}" Margin="{TemplateBinding Padding}" />
|
||
|
|
|
||
|
|
<ScrollBar
|
||
|
|
HorizontalAlignment="Right"
|
||
|
|
Maximum="{TemplateBinding ScrollableHeight}"
|
||
|
|
Name="PART_VerticalScrollBar"
|
||
|
|
Opacity="{Binding RelativeSource={RelativeSource AncestorType={x:Type ScrollViewer}}, Mode=OneWay, Path=(standardControls:ScrollViewerAttachedProperties.VerticalScrollBarOpacity)}"
|
||
|
|
Style="{StaticResource ThumbOnlyScrollBarStyle}"
|
||
|
|
Value="{TemplateBinding VerticalOffset}"
|
||
|
|
ViewportSize="{TemplateBinding ViewportHeight}"
|
||
|
|
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
|
||
|
|
Width="8.0" />
|
||
|
|
|
||
|
|
<ScrollBar
|
||
|
|
Height="8.0"
|
||
|
|
Maximum="{TemplateBinding ScrollableWidth}"
|
||
|
|
Name="PART_HorizontalScrollBar"
|
||
|
|
Opacity="{Binding RelativeSource={RelativeSource AncestorType={x:Type ScrollViewer}}, Mode=OneWay, Path=(standardControls:ScrollViewerAttachedProperties.HorizontalScrollBarOpacity)}"
|
||
|
|
Orientation="Horizontal"
|
||
|
|
Style="{StaticResource ThumbOnlyScrollBarStyle}"
|
||
|
|
Value="{TemplateBinding HorizontalOffset}"
|
||
|
|
VerticalAlignment="Bottom"
|
||
|
|
ViewportSize="{TemplateBinding ViewportWidth}"
|
||
|
|
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" />
|
||
|
|
</Grid>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
</Style>
|
||
|
|
|
||
|
|
<Style TargetType="{x:Type ScrollViewer}" x:Key="VerticalScrollViewerStyle">
|
||
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||
|
|
<Setter Property="Template">
|
||
|
|
<Setter.Value>
|
||
|
|
<ControlTemplate TargetType="{x:Type ScrollViewer}">
|
||
|
|
<Grid
|
||
|
|
Background="Transparent"
|
||
|
|
MouseLeave="OnMouseLeave"
|
||
|
|
PreviewMouseMove="OnPreviewMouseMove">
|
||
|
|
<ScrollContentPresenter CanContentScroll="{TemplateBinding CanContentScroll}" Margin="{TemplateBinding Padding}" />
|
||
|
|
|
||
|
|
<ScrollBar
|
||
|
|
HorizontalAlignment="Right"
|
||
|
|
Maximum="{TemplateBinding ScrollableHeight}"
|
||
|
|
Name="PART_VerticalScrollBar"
|
||
|
|
Opacity="{Binding RelativeSource={RelativeSource AncestorType={x:Type ScrollViewer}}, Mode=OneWay, Path=(standardControls:ScrollViewerAttachedProperties.VerticalScrollBarOpacity)}"
|
||
|
|
Style="{StaticResource ThumbOnlyScrollBarStyle}"
|
||
|
|
Value="{TemplateBinding VerticalOffset}"
|
||
|
|
ViewportSize="{TemplateBinding ViewportHeight}"
|
||
|
|
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
|
||
|
|
Width="8.0" />
|
||
|
|
</Grid>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
</Style>
|
||
|
|
|
||
|
|
<Style TargetType="{x:Type ScrollViewer}" x:Key="LeftScrollViewerStyle">
|
||
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||
|
|
<Setter Property="standardControls:ScrollViewerAttachedProperties.IsLeftVerticalScrollBar" Value="True" />
|
||
|
|
|
||
|
|
<Setter Property="Template">
|
||
|
|
<Setter.Value>
|
||
|
|
<ControlTemplate TargetType="{x:Type ScrollViewer}">
|
||
|
|
<Grid
|
||
|
|
Background="Transparent"
|
||
|
|
MouseLeave="OnMouseLeave"
|
||
|
|
PreviewMouseMove="OnPreviewMouseMove">
|
||
|
|
<ScrollContentPresenter CanContentScroll="{TemplateBinding CanContentScroll}" Margin="{TemplateBinding Padding}" />
|
||
|
|
|
||
|
|
<ScrollBar
|
||
|
|
Grid.Column="0"
|
||
|
|
Grid.Row="0"
|
||
|
|
HorizontalAlignment="Left"
|
||
|
|
Maximum="{TemplateBinding ScrollableHeight}"
|
||
|
|
Name="PART_VerticalScrollBar"
|
||
|
|
Opacity="{Binding RelativeSource={RelativeSource AncestorType={x:Type ScrollViewer}}, Mode=OneWay, Path=(standardControls:ScrollViewerAttachedProperties.VerticalScrollBarOpacity)}"
|
||
|
|
Style="{StaticResource ThumbOnlyScrollBarStyle}"
|
||
|
|
Value="{TemplateBinding VerticalOffset}"
|
||
|
|
ViewportSize="{TemplateBinding ViewportHeight}"
|
||
|
|
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
|
||
|
|
Width="8.0" />
|
||
|
|
|
||
|
|
<ScrollBar
|
||
|
|
Height="8.0"
|
||
|
|
Maximum="{TemplateBinding ScrollableWidth}"
|
||
|
|
Name="PART_HorizontalScrollBar"
|
||
|
|
Opacity="{Binding RelativeSource={RelativeSource AncestorType={x:Type ScrollViewer}}, Mode=OneWay, Path=(standardControls:ScrollViewerAttachedProperties.HorizontalScrollBarOpacity)}"
|
||
|
|
Orientation="Horizontal"
|
||
|
|
Style="{StaticResource ThumbOnlyScrollBarStyle}"
|
||
|
|
Value="{TemplateBinding HorizontalOffset}"
|
||
|
|
VerticalAlignment="Bottom"
|
||
|
|
ViewportSize="{TemplateBinding ViewportWidth}"
|
||
|
|
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" />
|
||
|
|
</Grid>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
</Style>
|
||
|
|
|
||
|
|
<Style TargetType="ScrollViewer" x:Key="GridViewScrollViewerStyle">
|
||
|
|
<Setter Property="Template">
|
||
|
|
<Setter.Value>
|
||
|
|
<ControlTemplate TargetType="ScrollViewer">
|
||
|
|
<Grid
|
||
|
|
Background="Transparent"
|
||
|
|
MouseLeave="OnMouseLeave"
|
||
|
|
PreviewMouseMove="OnPreviewMouseMove">
|
||
|
|
<DockPanel>
|
||
|
|
<ScrollViewer
|
||
|
|
DockPanel.Dock="Top"
|
||
|
|
Focusable="False"
|
||
|
|
HorizontalScrollBarVisibility="Hidden"
|
||
|
|
VerticalScrollBarVisibility="Hidden">
|
||
|
|
<!-- ReSharper disable Xaml.BindingWithContextNotResolved -->
|
||
|
|
<GridViewHeaderRowPresenter
|
||
|
|
AllowsColumnReorder="{Binding TemplatedParent.View.AllowsColumnReorder, RelativeSource={RelativeSource TemplatedParent}}"
|
||
|
|
ColumnHeaderContainerStyle="{Binding TemplatedParent.View.ColumnHeaderContainerStyle, RelativeSource={RelativeSource TemplatedParent}}"
|
||
|
|
ColumnHeaderContextMenu="{Binding TemplatedParent.View.ColumnHeaderContextMenu, RelativeSource={RelativeSource TemplatedParent}}"
|
||
|
|
ColumnHeaderTemplate="{Binding TemplatedParent.View.ColumnHeaderTemplate, RelativeSource={RelativeSource TemplatedParent}}"
|
||
|
|
ColumnHeaderTemplateSelector="{Binding TemplatedParent.View.ColumnHeaderTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}"
|
||
|
|
ColumnHeaderToolTip="{Binding TemplatedParent.View.ColumnHeaderToolTip, RelativeSource={RelativeSource TemplatedParent}}"
|
||
|
|
Columns="{Binding TemplatedParent.View.Columns, RelativeSource={RelativeSource TemplatedParent}}"
|
||
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||
|
|
<!-- ReSharper restore Xaml.BindingWithContextNotResolved -->
|
||
|
|
</ScrollViewer>
|
||
|
|
|
||
|
|
<ScrollContentPresenter
|
||
|
|
CanContentScroll="True"
|
||
|
|
CanHorizontallyScroll="False"
|
||
|
|
CanVerticallyScroll="False"
|
||
|
|
KeyboardNavigation.DirectionalNavigation="Local"
|
||
|
|
Margin="{TemplateBinding Padding}"
|
||
|
|
Name="PART_ScrollContentPresenter" />
|
||
|
|
</DockPanel>
|
||
|
|
|
||
|
|
<!-- 24はヘッダーの高さ -->
|
||
|
|
<ScrollBar
|
||
|
|
HorizontalAlignment="Right"
|
||
|
|
Margin="0,24,0,0"
|
||
|
|
Maximum="{TemplateBinding ScrollableHeight}"
|
||
|
|
Name="PART_VerticalScrollBar"
|
||
|
|
Opacity="{Binding RelativeSource={RelativeSource AncestorType={x:Type ScrollViewer}}, Mode=OneWay, Path=(standardControls:ScrollViewerAttachedProperties.VerticalScrollBarOpacity)}"
|
||
|
|
Style="{StaticResource ThumbOnlyScrollBarStyle}"
|
||
|
|
Value="{TemplateBinding VerticalOffset}"
|
||
|
|
ViewportSize="{TemplateBinding ViewportHeight}"
|
||
|
|
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
|
||
|
|
Width="8.0" />
|
||
|
|
|
||
|
|
<ScrollBar
|
||
|
|
Height="8.0"
|
||
|
|
Maximum="{TemplateBinding ScrollableWidth}"
|
||
|
|
Name="PART_HorizontalScrollBar"
|
||
|
|
Opacity="{Binding RelativeSource={RelativeSource AncestorType={x:Type ScrollViewer}}, Mode=OneWay, Path=(standardControls:ScrollViewerAttachedProperties.HorizontalScrollBarOpacity)}"
|
||
|
|
Orientation="Horizontal"
|
||
|
|
Style="{StaticResource ThumbOnlyScrollBarStyle}"
|
||
|
|
Value="{TemplateBinding HorizontalOffset}"
|
||
|
|
VerticalAlignment="Bottom"
|
||
|
|
ViewportSize="{TemplateBinding ViewportWidth}"
|
||
|
|
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" />
|
||
|
|
</Grid>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
</Style>
|
||
|
|
|
||
|
|
<Style TargetType="{x:Type ScrollViewer}" x:Key="FlatScrollViewerStyle">
|
||
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||
|
|
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
|
||
|
|
<Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
|
||
|
|
|
||
|
|
<Setter Property="Template">
|
||
|
|
<Setter.Value>
|
||
|
|
<ControlTemplate TargetType="{x:Type ScrollViewer}">
|
||
|
|
<Grid Background="{TemplateBinding Background}">
|
||
|
|
<Grid.ColumnDefinitions>
|
||
|
|
<ColumnDefinition Width="*" />
|
||
|
|
<ColumnDefinition Width="Auto" />
|
||
|
|
</Grid.ColumnDefinitions>
|
||
|
|
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="*" />
|
||
|
|
<RowDefinition Height="Auto" />
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
|
||
|
|
<ScrollContentPresenter CanContentScroll="{TemplateBinding CanContentScroll}" Margin="{TemplateBinding Padding}" />
|
||
|
|
|
||
|
|
<ScrollBar
|
||
|
|
Grid.Column="1"
|
||
|
|
Grid.Row="0"
|
||
|
|
Maximum="{TemplateBinding ScrollableHeight}"
|
||
|
|
Name="PART_VerticalScrollBar"
|
||
|
|
Style="{StaticResource ThumbOnlyScrollBarStyle}"
|
||
|
|
Value="{TemplateBinding VerticalOffset}"
|
||
|
|
ViewportSize="{TemplateBinding ViewportHeight}"
|
||
|
|
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" />
|
||
|
|
|
||
|
|
<ScrollBar
|
||
|
|
Grid.Column="0"
|
||
|
|
Grid.Row="1"
|
||
|
|
Maximum="{TemplateBinding ScrollableWidth}"
|
||
|
|
Name="PART_HorizontalScrollBar"
|
||
|
|
Orientation="Horizontal"
|
||
|
|
Style="{StaticResource ThumbOnlyScrollBarStyle}"
|
||
|
|
Value="{TemplateBinding HorizontalOffset}"
|
||
|
|
ViewportSize="{TemplateBinding ViewportWidth}"
|
||
|
|
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" />
|
||
|
|
</Grid>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
</Style>
|
||
|
|
|
||
|
|
<Style TargetType="{x:Type ScrollViewer}" x:Key="BasicScrollViewerStyle">
|
||
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||
|
|
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
|
||
|
|
<Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
|
||
|
|
|
||
|
|
<Setter Property="Template">
|
||
|
|
<Setter.Value>
|
||
|
|
<ControlTemplate TargetType="{x:Type ScrollViewer}">
|
||
|
|
<Grid Background="{TemplateBinding Background}">
|
||
|
|
<Grid.ColumnDefinitions>
|
||
|
|
<ColumnDefinition Width="*" />
|
||
|
|
<ColumnDefinition Width="Auto" />
|
||
|
|
</Grid.ColumnDefinitions>
|
||
|
|
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="*" />
|
||
|
|
<RowDefinition Height="Auto" />
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
|
||
|
|
<ScrollContentPresenter
|
||
|
|
CanContentScroll="{TemplateBinding CanContentScroll}"
|
||
|
|
Grid.ColumnSpan="2"
|
||
|
|
Grid.RowSpan="2"
|
||
|
|
Margin="{TemplateBinding Padding}" />
|
||
|
|
|
||
|
|
<ScrollBar
|
||
|
|
Grid.Column="1"
|
||
|
|
Grid.Row="0"
|
||
|
|
Maximum="{TemplateBinding ScrollableHeight}"
|
||
|
|
Name="PART_VerticalScrollBar"
|
||
|
|
Style="{StaticResource ThumbOnlyMouseOverScrollBarStyle}"
|
||
|
|
Value="{TemplateBinding VerticalOffset}"
|
||
|
|
ViewportSize="{TemplateBinding ViewportHeight}"
|
||
|
|
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" />
|
||
|
|
|
||
|
|
<ScrollBar
|
||
|
|
Grid.Column="0"
|
||
|
|
Grid.Row="1"
|
||
|
|
Maximum="{TemplateBinding ScrollableWidth}"
|
||
|
|
Name="PART_HorizontalScrollBar"
|
||
|
|
Orientation="Horizontal"
|
||
|
|
Style="{StaticResource ThumbOnlyMouseOverScrollBarStyle}"
|
||
|
|
Value="{TemplateBinding HorizontalOffset}"
|
||
|
|
ViewportSize="{TemplateBinding ViewportWidth}"
|
||
|
|
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" />
|
||
|
|
</Grid>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
</Style>
|
||
|
|
|
||
|
|
<Style BasedOn="{StaticResource DefaultScrollViewerStyle}" TargetType="{x:Type ScrollViewer}" />
|
||
|
|
</ResourceDictionary>
|