更新
This commit is contained in:
@@ -1,15 +1,8 @@
|
||||
<!--
|
||||
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:sys="clr-namespace:System;assembly=mscorlib">
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Duration x:Key="ScrollAnimationDuration">0:0:0.16</Duration>
|
||||
<Duration x:Key="ButtonHoverAnimationDuration">0:0:0.16</Duration>
|
||||
@@ -17,8 +10,8 @@
|
||||
<sys:Double x:Key="LineButtonHeight">12</sys:Double>
|
||||
<sys:Double x:Key="LineButtonWidth">12</sys:Double>
|
||||
|
||||
<Style x:Key="UiScrollBarLineButton" TargetType="{x:Type RepeatButton}">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ScrollBarButtonArrowForeground}" />
|
||||
<Style TargetType="{x:Type RepeatButton}" x:Key="UiScrollBarLineButton">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ControlStrongFillColorDefaultBrush}" />
|
||||
<Setter Property="Width" Value="{StaticResource LineButtonWidth}" />
|
||||
<Setter Property="Height" Value="{StaticResource LineButtonHeight}" />
|
||||
<Setter Property="FontSize" Value="11" />
|
||||
@@ -30,20 +23,20 @@
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type RepeatButton}">
|
||||
<Border
|
||||
x:Name="Border"
|
||||
Width="{TemplateBinding Width}"
|
||||
Background="{DynamicResource SubtleFillColorTransparentBrush}"
|
||||
CornerRadius="6"
|
||||
Height="{TemplateBinding Height}"
|
||||
Margin="{TemplateBinding Margin}"
|
||||
Background="{DynamicResource ScrollBarButtonBackground}"
|
||||
CornerRadius="6">
|
||||
Width="{TemplateBinding Width}"
|
||||
x:Name="Border">
|
||||
<controls:SymbolIcon
|
||||
Margin="0,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Filled="True"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Symbol="{Binding Path=Content, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" />
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,0,0,0"
|
||||
Symbol="{Binding Path=Content, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
|
||||
VerticalAlignment="Center" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
@@ -51,11 +44,11 @@
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ButtonHoverAnimationDuration}"
|
||||
From="0.0"
|
||||
Storyboard.TargetName="Border"
|
||||
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Opacity)"
|
||||
From="0.0"
|
||||
To="1.0"
|
||||
Duration="{StaticResource ButtonHoverAnimationDuration}" />
|
||||
To="1.0" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.EnterActions>
|
||||
@@ -63,11 +56,11 @@
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ButtonHoverAnimationDuration}"
|
||||
From="1.0"
|
||||
Storyboard.TargetName="Border"
|
||||
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Opacity)"
|
||||
From="1.0"
|
||||
To="0.0"
|
||||
Duration="{StaticResource ButtonHoverAnimationDuration}" />
|
||||
To="0.0" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.ExitActions>
|
||||
@@ -78,7 +71,7 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="UiScrollBarPageButton" TargetType="{x:Type RepeatButton}">
|
||||
<Style TargetType="{x:Type RepeatButton}" x:Key="UiScrollBarPageButton">
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
<Setter Property="OverridesDefaultStyle" Value="true" />
|
||||
<Setter Property="IsTabStop" Value="False" />
|
||||
@@ -92,8 +85,8 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="UiScrollBarThumb" TargetType="{x:Type Thumb}">
|
||||
<Setter Property="Background" Value="{DynamicResource ScrollBarThumbFill}" />
|
||||
<Style TargetType="{x:Type Thumb}" x:Key="UiScrollBarThumb">
|
||||
<Setter Property="Background" Value="{DynamicResource ControlStrongFillColorDefaultBrush}" />
|
||||
<Setter Property="Border.CornerRadius" Value="4" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||
@@ -112,7 +105,7 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<ControlTemplate x:Key="UiVerticalScrollBar" TargetType="{x:Type ScrollBar}">
|
||||
<ControlTemplate TargetType="{x:Type ScrollBar}" x:Key="UiVerticalScrollBar">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition MaxHeight="14" />
|
||||
@@ -120,26 +113,26 @@
|
||||
<RowDefinition MaxHeight="14" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border
|
||||
x:Name="PART_Border"
|
||||
Grid.RowSpan="3"
|
||||
Width="12"
|
||||
HorizontalAlignment="Center"
|
||||
Background="{DynamicResource ScrollBarTrackFillPointerOver}"
|
||||
Background="{DynamicResource AcrylicBackgroundFillColorDefaultBrush}"
|
||||
CornerRadius="6"
|
||||
Opacity="0" />
|
||||
Grid.RowSpan="3"
|
||||
HorizontalAlignment="Center"
|
||||
Opacity="0"
|
||||
Width="12"
|
||||
x:Name="PART_Border" />
|
||||
<RepeatButton
|
||||
x:Name="PART_ButtonScrollUp"
|
||||
Grid.Row="0"
|
||||
HorizontalContentAlignment="Left"
|
||||
Command="ScrollBar.LineUpCommand"
|
||||
Content="{x:Static controls:SymbolRegular.CaretUp24}"
|
||||
Grid.Row="0"
|
||||
HorizontalContentAlignment="Left"
|
||||
Opacity="0"
|
||||
Style="{StaticResource UiScrollBarLineButton}" />
|
||||
Style="{StaticResource UiScrollBarLineButton}"
|
||||
x:Name="PART_ButtonScrollUp" />
|
||||
<Track
|
||||
x:Name="PART_Track"
|
||||
Grid.Row="1"
|
||||
IsDirectionReversed="True"
|
||||
Width="6"
|
||||
IsDirectionReversed="True">
|
||||
x:Name="PART_Track">
|
||||
<Track.DecreaseRepeatButton>
|
||||
<RepeatButton Command="ScrollBar.PageUpCommand" Style="{StaticResource UiScrollBarPageButton}" />
|
||||
</Track.DecreaseRepeatButton>
|
||||
@@ -157,13 +150,13 @@
|
||||
</Track.IncreaseRepeatButton>
|
||||
</Track>
|
||||
<RepeatButton
|
||||
x:Name="PART_ButtonScrollDown"
|
||||
Grid.Row="2"
|
||||
HorizontalContentAlignment="Left"
|
||||
Command="ScrollBar.LineDownCommand"
|
||||
Content="{x:Static controls:SymbolRegular.CaretDown24}"
|
||||
Grid.Row="2"
|
||||
HorizontalContentAlignment="Left"
|
||||
Opacity="0"
|
||||
Style="{StaticResource UiScrollBarLineButton}" />
|
||||
Style="{StaticResource UiScrollBarLineButton}"
|
||||
x:Name="PART_ButtonScrollDown" />
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
@@ -171,29 +164,29 @@
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ScrollAnimationDuration}"
|
||||
From="6"
|
||||
Storyboard.TargetName="PART_Track"
|
||||
Storyboard.TargetProperty="Width"
|
||||
From="6"
|
||||
To="8"
|
||||
Duration="{StaticResource ScrollAnimationDuration}" />
|
||||
To="8" />
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ScrollAnimationDuration}"
|
||||
From="0.0"
|
||||
Storyboard.TargetName="PART_Border"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
From="0.0"
|
||||
To="1.0"
|
||||
Duration="{StaticResource ScrollAnimationDuration}" />
|
||||
To="1.0" />
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ScrollAnimationDuration}"
|
||||
From="0.0"
|
||||
Storyboard.TargetName="PART_ButtonScrollUp"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
From="0.0"
|
||||
To="1.0"
|
||||
Duration="{StaticResource ScrollAnimationDuration}" />
|
||||
To="1.0" />
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ScrollAnimationDuration}"
|
||||
From="0.0"
|
||||
Storyboard.TargetName="PART_ButtonScrollDown"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
From="0.0"
|
||||
To="1.0"
|
||||
Duration="{StaticResource ScrollAnimationDuration}" />
|
||||
To="1.0" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.EnterActions>
|
||||
@@ -201,29 +194,29 @@
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ScrollAnimationDuration}"
|
||||
From="8"
|
||||
Storyboard.TargetName="PART_Track"
|
||||
Storyboard.TargetProperty="Width"
|
||||
From="8"
|
||||
To="6"
|
||||
Duration="{StaticResource ScrollAnimationDuration}" />
|
||||
To="6" />
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ScrollAnimationDuration}"
|
||||
From="1.0"
|
||||
Storyboard.TargetName="PART_Border"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
From="1.0"
|
||||
To="0.0"
|
||||
Duration="{StaticResource ScrollAnimationDuration}" />
|
||||
To="0.0" />
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ScrollAnimationDuration}"
|
||||
From="1.0"
|
||||
Storyboard.TargetName="PART_ButtonScrollUp"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
From="1.0"
|
||||
To="0.0"
|
||||
Duration="{StaticResource ScrollAnimationDuration}" />
|
||||
To="0.0" />
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ScrollAnimationDuration}"
|
||||
From="1.0"
|
||||
Storyboard.TargetName="PART_ButtonScrollDown"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
From="1.0"
|
||||
To="0.0"
|
||||
Duration="{StaticResource ScrollAnimationDuration}" />
|
||||
To="0.0" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.ExitActions>
|
||||
@@ -231,7 +224,7 @@
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<ControlTemplate x:Key="UiHorizontalScrollBar" TargetType="{x:Type ScrollBar}">
|
||||
<ControlTemplate TargetType="{x:Type ScrollBar}" x:Key="UiHorizontalScrollBar">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition MaxWidth="18" />
|
||||
@@ -239,28 +232,28 @@
|
||||
<ColumnDefinition MaxWidth="18" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border
|
||||
x:Name="PART_Border"
|
||||
Background="{DynamicResource SubtleFillColorTransparentBrush}"
|
||||
CornerRadius="6"
|
||||
Grid.ColumnSpan="3"
|
||||
Height="12"
|
||||
Opacity="0"
|
||||
VerticalAlignment="Center"
|
||||
Background="{DynamicResource ScrollBarButtonBackground}"
|
||||
CornerRadius="6"
|
||||
Opacity="0" />
|
||||
x:Name="PART_Border" />
|
||||
|
||||
<RepeatButton
|
||||
x:Name="PART_ButtonScrollLeft"
|
||||
Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Command="ScrollBar.LineLeftCommand"
|
||||
Content="{x:Static controls:SymbolRegular.CaretLeft24}"
|
||||
Grid.Column="0"
|
||||
Opacity="0"
|
||||
Style="{StaticResource UiScrollBarLineButton}" />
|
||||
Style="{StaticResource UiScrollBarLineButton}"
|
||||
VerticalAlignment="Center"
|
||||
x:Name="PART_ButtonScrollLeft" />
|
||||
<Track
|
||||
x:Name="PART_Track"
|
||||
Grid.Column="1"
|
||||
Height="6"
|
||||
IsDirectionReversed="False"
|
||||
VerticalAlignment="Center"
|
||||
IsDirectionReversed="False">
|
||||
x:Name="PART_Track">
|
||||
<Track.DecreaseRepeatButton>
|
||||
<RepeatButton Command="ScrollBar.PageLeftCommand" Style="{StaticResource UiScrollBarPageButton}" />
|
||||
</Track.DecreaseRepeatButton>
|
||||
@@ -275,13 +268,13 @@
|
||||
</Track.IncreaseRepeatButton>
|
||||
</Track>
|
||||
<RepeatButton
|
||||
x:Name="PART_ButtonScrollRight"
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Center"
|
||||
Command="ScrollBar.LineRightCommand"
|
||||
Content="{x:Static controls:SymbolRegular.CaretRight24}"
|
||||
Grid.Column="2"
|
||||
Opacity="0"
|
||||
Style="{StaticResource UiScrollBarLineButton}" />
|
||||
Style="{StaticResource UiScrollBarLineButton}"
|
||||
VerticalAlignment="Center"
|
||||
x:Name="PART_ButtonScrollRight" />
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
@@ -289,29 +282,29 @@
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ScrollAnimationDuration}"
|
||||
From="6"
|
||||
Storyboard.TargetName="PART_Track"
|
||||
Storyboard.TargetProperty="Height"
|
||||
From="6"
|
||||
To="8"
|
||||
Duration="{StaticResource ScrollAnimationDuration}" />
|
||||
To="8" />
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ScrollAnimationDuration}"
|
||||
From="0.0"
|
||||
Storyboard.TargetName="PART_Border"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
From="0.0"
|
||||
To="1.0"
|
||||
Duration="{StaticResource ScrollAnimationDuration}" />
|
||||
To="1.0" />
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ScrollAnimationDuration}"
|
||||
From="0.0"
|
||||
Storyboard.TargetName="PART_ButtonScrollLeft"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
From="0.0"
|
||||
To="1.0"
|
||||
Duration="{StaticResource ScrollAnimationDuration}" />
|
||||
To="1.0" />
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ScrollAnimationDuration}"
|
||||
From="0.0"
|
||||
Storyboard.TargetName="PART_ButtonScrollRight"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
From="0.0"
|
||||
To="1.0"
|
||||
Duration="{StaticResource ScrollAnimationDuration}" />
|
||||
To="1.0" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.EnterActions>
|
||||
@@ -319,29 +312,29 @@
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ScrollAnimationDuration}"
|
||||
From="8"
|
||||
Storyboard.TargetName="PART_Track"
|
||||
Storyboard.TargetProperty="Height"
|
||||
From="8"
|
||||
To="6"
|
||||
Duration="{StaticResource ScrollAnimationDuration}" />
|
||||
To="6" />
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ScrollAnimationDuration}"
|
||||
From="1.0"
|
||||
Storyboard.TargetName="PART_Border"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
From="1.0"
|
||||
To="0.0"
|
||||
Duration="{StaticResource ScrollAnimationDuration}" />
|
||||
To="0.0" />
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ScrollAnimationDuration}"
|
||||
From="1.0"
|
||||
Storyboard.TargetName="PART_ButtonScrollLeft"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
From="1.0"
|
||||
To="0.0"
|
||||
Duration="{StaticResource ScrollAnimationDuration}" />
|
||||
To="0.0" />
|
||||
<DoubleAnimation
|
||||
Duration="{StaticResource ScrollAnimationDuration}"
|
||||
From="1.0"
|
||||
Storyboard.TargetName="PART_ButtonScrollRight"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
From="1.0"
|
||||
To="0.0"
|
||||
Duration="{StaticResource ScrollAnimationDuration}" />
|
||||
To="0.0" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.ExitActions>
|
||||
@@ -349,7 +342,7 @@
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<Style x:Key="UiScrollBar" TargetType="{x:Type ScrollBar}">
|
||||
<Style TargetType="{x:Type ScrollBar}" x:Key="UiScrollBar">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
|
||||
Reference in New Issue
Block a user