This repository has been archived by the owner on Aug 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b526c7d
commit d18c196
Showing
7 changed files
with
239 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | ||
|
||
|
||
|
||
|
||
|
||
<Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}"> | ||
<Setter Property="OverridesDefaultStyle" Value="true"/> | ||
<Setter Property="BorderBrush" Value="LightGray"/> | ||
<Setter Property="IsTabStop" Value="false"/> | ||
<Setter Property="Opacity" Value="1"/> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type Thumb}"> | ||
<Rectangle x:Name="recThumb" Fill="{TemplateBinding BorderBrush}" RadiusX="3" RadiusY="3" /> | ||
<ControlTemplate.Triggers> | ||
<Trigger Property="IsDragging" Value="True"> | ||
<Setter Property="Fill" TargetName="recThumb" Value="#606060"/> | ||
</Trigger> | ||
</ControlTemplate.Triggers> | ||
</ControlTemplate> | ||
|
||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
<Style x:Key="HorizontalScrollBarPageButton" TargetType="{x:Type RepeatButton}"> | ||
<Setter Property="OverridesDefaultStyle" Value="true"/> | ||
<Setter Property="Background" Value="Transparent"/> | ||
<Setter Property="Focusable" Value="false"/> | ||
<Setter Property="IsTabStop" Value="false"/> | ||
<Setter Property="Opacity" Value="0"/> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type RepeatButton}"> | ||
<Rectangle Fill="{TemplateBinding Background}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"/> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
<Style x:Key="VerticalScrollBarPageButton" TargetType="{x:Type RepeatButton}"> | ||
<Setter Property="OverridesDefaultStyle" Value="true"/> | ||
<Setter Property="Background" Value="Transparent"/> | ||
<Setter Property="Focusable" Value="false"/> | ||
<Setter Property="IsTabStop" Value="false"/> | ||
<Setter Property="Opacity" Value="0"/> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type RepeatButton}"> | ||
<Rectangle Fill="{TemplateBinding Background}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"/> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
|
||
<Style x:Key="for_scrollbar" | ||
TargetType="{x:Type ScrollBar}"> | ||
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/> | ||
<Setter Property="Stylus.IsFlicksEnabled" Value="false"/> | ||
<Setter Property="Background" Value="Transparent"/> | ||
<Setter Property="Margin" Value="0,1,0,6"/> | ||
<Setter Property="Width" Value="10"/> | ||
<Setter Property="MinWidth" Value="10"/> | ||
<Setter Property="Opacity" Value="0"/> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type ScrollBar}"> | ||
<Grid x:Name="Bg" SnapsToDevicePixels="true"> | ||
<Track x:Name="PART_Track" IsEnabled="{TemplateBinding IsMouseOver}" IsDirectionReversed="true"> | ||
<Track.DecreaseRepeatButton> | ||
<RepeatButton Style="{StaticResource VerticalScrollBarPageButton}" Command="{x:Static ScrollBar.PageUpCommand}"/> | ||
</Track.DecreaseRepeatButton> | ||
<Track.IncreaseRepeatButton> | ||
<RepeatButton Style="{StaticResource VerticalScrollBarPageButton}" Command="{x:Static ScrollBar.PageDownCommand}"/> | ||
</Track.IncreaseRepeatButton> | ||
<Track.Thumb> | ||
<Thumb Style="{StaticResource ScrollBarThumb}"/> | ||
</Track.Thumb> | ||
</Track> | ||
</Grid> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
<Style.Triggers> | ||
<Trigger Property="Orientation" Value="Horizontal"> | ||
<Setter Property="Background" Value="Transparent"/> | ||
<Setter Property="Margin" Value="1,0,6,0"/> | ||
<Setter Property="Height" Value="10"/> | ||
<Setter Property="MinHeight" Value="10"/> | ||
<Setter Property="Width" Value="Auto"/> | ||
<Setter Property="Opacity" Value="0"/> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type ScrollBar}"> | ||
<Grid x:Name="Bg" SnapsToDevicePixels="true"> | ||
<Track x:Name="PART_Track" IsEnabled="{TemplateBinding IsMouseOver}"> | ||
<Track.DecreaseRepeatButton> | ||
<RepeatButton Style="{StaticResource HorizontalScrollBarPageButton}" Command="{x:Static ScrollBar.PageLeftCommand}"/> | ||
</Track.DecreaseRepeatButton> | ||
<Track.IncreaseRepeatButton> | ||
<RepeatButton Style="{StaticResource HorizontalScrollBarPageButton}" Command="{x:Static ScrollBar.PageRightCommand}"/> | ||
</Track.IncreaseRepeatButton> | ||
<Track.Thumb> | ||
<Thumb Style="{StaticResource ScrollBarThumb}"/> | ||
</Track.Thumb> | ||
</Track> | ||
</Grid> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Trigger> | ||
</Style.Triggers> | ||
</Style> | ||
|
||
<!-- ScrollViewer --> | ||
<Style TargetType="{x:Type ScrollViewer}" x:Key="ScrollViewerStyle"> | ||
<Setter Property="BorderBrush" Value="LightGray"/> | ||
<Setter Property="BorderThickness" Value="0"/> | ||
<Setter Property="HorizontalContentAlignment" Value="Left"/> | ||
<Setter Property="HorizontalScrollBarVisibility" Value="Auto"/> | ||
<Setter Property="VerticalContentAlignment" Value="Top"/> | ||
<Setter Property="VerticalScrollBarVisibility" Value="Auto"/> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type ScrollViewer}"> | ||
<Border BorderBrush="{TemplateBinding BorderBrush}" | ||
BorderThickness="{TemplateBinding BorderThickness}" | ||
SnapsToDevicePixels="True"> | ||
<Grid Background="{TemplateBinding Background}"> | ||
<ScrollContentPresenter | ||
Cursor="{TemplateBinding Cursor}" | ||
Margin="{TemplateBinding Padding}" | ||
ContentTemplate="{TemplateBinding ContentTemplate}"/> | ||
<ScrollBar x:Name="PART_VerticalScrollBar" | ||
Opacity="1" | ||
HorizontalAlignment="Right" | ||
Maximum="{TemplateBinding ScrollableHeight}" | ||
Orientation="Vertical" | ||
Style="{StaticResource for_scrollbar}" | ||
ViewportSize="{TemplateBinding ViewportHeight}" | ||
Value="{TemplateBinding VerticalOffset}" | ||
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" | ||
Width="10"/> | ||
<ScrollBar x:Name="PART_HorizontalScrollBar" | ||
Opacity="1" | ||
Maximum="{TemplateBinding ScrollableWidth}" | ||
Orientation="Horizontal" | ||
Style="{StaticResource for_scrollbar}" | ||
VerticalAlignment="Bottom" | ||
Value="{TemplateBinding HorizontalOffset}" | ||
ViewportSize="{TemplateBinding ViewportWidth}" | ||
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" | ||
Height="10"/> | ||
</Grid> | ||
</Border> | ||
<ControlTemplate.Triggers> | ||
<EventTrigger RoutedEvent="ScrollChanged"> | ||
<BeginStoryboard> | ||
<Storyboard> | ||
<DoubleAnimation | ||
Storyboard.TargetName="PART_VerticalScrollBar" | ||
Storyboard.TargetProperty="Opacity" | ||
To="1" | ||
Duration="0:0:1"/> | ||
<DoubleAnimation | ||
Storyboard.TargetName="PART_VerticalScrollBar" | ||
Storyboard.TargetProperty="Opacity" | ||
To="0" | ||
Duration="0:0:1" | ||
BeginTime="0:0:1"/> | ||
<DoubleAnimation | ||
Storyboard.TargetName="PART_HorizontalScrollBar" | ||
Storyboard.TargetProperty="Opacity" | ||
To="1" | ||
Duration="0:0:1"/> | ||
<DoubleAnimation | ||
Storyboard.TargetName="PART_HorizontalScrollBar" | ||
Storyboard.TargetProperty="Opacity" | ||
To="0" | ||
Duration="0:0:1" | ||
BeginTime="0:0:1"/> | ||
</Storyboard> | ||
</BeginStoryboard> | ||
</EventTrigger> | ||
<EventTrigger RoutedEvent="MouseEnter" | ||
SourceName="PART_VerticalScrollBar"> | ||
<BeginStoryboard> | ||
<Storyboard> | ||
<DoubleAnimation | ||
Storyboard.TargetName="PART_VerticalScrollBar" | ||
Storyboard.TargetProperty="Opacity" | ||
To="1" | ||
Duration="0:0:1"/> | ||
</Storyboard> | ||
</BeginStoryboard> | ||
</EventTrigger> | ||
<EventTrigger RoutedEvent="MouseLeave" | ||
SourceName="PART_VerticalScrollBar"> | ||
<BeginStoryboard> | ||
<Storyboard> | ||
<DoubleAnimation | ||
Storyboard.TargetName="PART_VerticalScrollBar" | ||
Storyboard.TargetProperty="Opacity" | ||
To="0" | ||
Duration="0:0:1"/> | ||
</Storyboard> | ||
</BeginStoryboard> | ||
</EventTrigger> | ||
</ControlTemplate.Triggers> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters