|
@@ -0,0 +1,225 @@
|
|
|
|
|
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
|
+ <ResourceDictionary.MergedDictionaries>
|
|
|
|
|
+ <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Assets/Brushes.xaml"/>
|
|
|
|
|
+ </ResourceDictionary.MergedDictionaries>
|
|
|
|
|
+ <!--滚动条两头的按钮-->
|
|
|
|
|
+ <Style x:Key="ScrollBarButton" TargetType="{x:Type RepeatButton}">
|
|
|
|
|
+ <Setter Property="Background" Value="Transparent"></Setter>
|
|
|
|
|
+ <Setter Property="Foreground" Value="Gray"></Setter>
|
|
|
|
|
+ <Setter Property="VerticalAlignment" Value="Center"></Setter>
|
|
|
|
|
+ <Setter Property="Template">
|
|
|
|
|
+ <Setter.Value>
|
|
|
|
|
+ <ControlTemplate TargetType="{x:Type RepeatButton}">
|
|
|
|
|
+ <Border>
|
|
|
|
|
+ <Path x:Name="btnIcon" Data="{TemplateBinding Content}"
|
|
|
|
|
+ Fill="{TemplateBinding Foreground}"
|
|
|
|
|
+ Width="25" Height="15" Stretch="Uniform"/>
|
|
|
|
|
+ </Border>
|
|
|
|
|
+ <ControlTemplate.Triggers>
|
|
|
|
|
+ <Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
+ <Setter Property="Fill" Value="Red" TargetName="btnIcon"></Setter>
|
|
|
|
|
+ </Trigger>
|
|
|
|
|
+ <Trigger Property="IsEnabled" Value="False">
|
|
|
|
|
+ <Setter Property="Opacity" Value="0.5" TargetName="btnIcon"/>
|
|
|
|
|
+ </Trigger>
|
|
|
|
|
+ </ControlTemplate.Triggers>
|
|
|
|
|
+ </ControlTemplate>
|
|
|
|
|
+ </Setter.Value>
|
|
|
|
|
+ </Setter>
|
|
|
|
|
+ </Style>
|
|
|
|
|
+ <!--滚动条滑块两边按钮样式-->
|
|
|
|
|
+ <Style x:Key="ScrollBarTrackButton" TargetType="{x:Type RepeatButton}">
|
|
|
|
|
+ <Setter Property="Background" Value="#CCCCCC"></Setter>
|
|
|
|
|
+ <Setter Property="Template">
|
|
|
|
|
+ <Setter.Value>
|
|
|
|
|
+ <ControlTemplate TargetType="{x:Type RepeatButton}">
|
|
|
|
|
+ <Border Background="{TemplateBinding Background}"></Border>
|
|
|
|
|
+ </ControlTemplate>
|
|
|
|
|
+ </Setter.Value>
|
|
|
|
|
+ </Setter>
|
|
|
|
|
+ </Style>
|
|
|
|
|
+ <!--滚动条滑块样式-->
|
|
|
|
|
+ <ControlTemplate x:Key="ThumbTemplate" TargetType="Thumb">
|
|
|
|
|
+ <Border x:Name="sliderBar" CornerRadius="3"
|
|
|
|
|
+ Margin="2" SnapsToDevicePixels="True"
|
|
|
|
|
+ Background="#505050"/>
|
|
|
|
|
+ <ControlTemplate.Triggers>
|
|
|
|
|
+ <Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
+ <Setter Property="Background" Value="#8E8E93" TargetName="sliderBar"></Setter>
|
|
|
|
|
+ </Trigger>
|
|
|
|
|
+ <Trigger Property="IsMouseOver" Value="False">
|
|
|
|
|
+ <Setter Property="Background" Value="#505050" TargetName="sliderBar"></Setter>
|
|
|
|
|
+ </Trigger>
|
|
|
|
|
+ <Trigger Property="IsEnabled" Value="False">
|
|
|
|
|
+ <Setter Property="Opacity" Value="0.5" TargetName="sliderBar"></Setter>
|
|
|
|
|
+ </Trigger>
|
|
|
|
|
+ </ControlTemplate.Triggers>
|
|
|
|
|
+ </ControlTemplate>
|
|
|
|
|
+ <!--水平滚滚动条模板-->
|
|
|
|
|
+ <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
|
|
|
|
|
+ <Grid x:Name="HorizontalRoot" Height="{TemplateBinding Height}">
|
|
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
|
|
+ <ColumnDefinition Width="Auto" />
|
|
|
|
|
+ <ColumnDefinition Width="*" />
|
|
|
|
|
+ <ColumnDefinition Width="Auto" />
|
|
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
|
|
+ <!--内部背景-->
|
|
|
|
|
+ <Border x:Name="BgInner" Grid.Column="1" SnapsToDevicePixels="True" CornerRadius="6"
|
|
|
|
|
+ Background="#CCCCCC"/>
|
|
|
|
|
+ <!--左按钮-->
|
|
|
|
|
+ <Border Grid.Column="0">
|
|
|
|
|
+ <RepeatButton x:Name="HorizontalSmallDecrease"
|
|
|
|
|
+ Content="{DynamicResource Icon.ArrowLeftRight}"
|
|
|
|
|
+ Style="{StaticResource ScrollBarButton}"
|
|
|
|
|
+ IsTabStop="False" Interval="50"
|
|
|
|
|
+ Width="15" Height="15"
|
|
|
|
|
+ Margin="0,1,0,0" Command="ScrollBar.LineLeftCommand"/>
|
|
|
|
|
+ </Border>
|
|
|
|
|
+ <!--中间滑动区域-->
|
|
|
|
|
+ <Track x:Name="PART_Track" IsDirectionReversed="False" Grid.Column="1">
|
|
|
|
|
+ <!--左滑块-->
|
|
|
|
|
+ <Track.DecreaseRepeatButton>
|
|
|
|
|
+ <RepeatButton x:Name="HorizontalLargeDecrease" Command="ScrollBar.PageLeftCommand"
|
|
|
|
|
+ IsTabStop="False" Interval="50" Style="{StaticResource ScrollBarTrackButton}" />
|
|
|
|
|
+ </Track.DecreaseRepeatButton>
|
|
|
|
|
+ <!--中间滑块 Margin="1" VerticalAlignment="Center" VerticalContentAlignment="Center" -->
|
|
|
|
|
+ <Track.Thumb>
|
|
|
|
|
+ <Thumb Template="{StaticResource ThumbTemplate}" />
|
|
|
|
|
+ </Track.Thumb>
|
|
|
|
|
+ <!--右滑块-->
|
|
|
|
|
+ <Track.IncreaseRepeatButton>
|
|
|
|
|
+ <RepeatButton x:Name="HorizontalLargeIncrease" Command="ScrollBar.PageRightCommand"
|
|
|
|
|
+ IsTabStop="False" Interval="50" Style="{StaticResource ScrollBarTrackButton}" />
|
|
|
|
|
+ </Track.IncreaseRepeatButton>
|
|
|
|
|
+ </Track>
|
|
|
|
|
+ <!--右按钮-->
|
|
|
|
|
+ <Border Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center"
|
|
|
|
|
+ Background="#AAAAAA">
|
|
|
|
|
+ <RepeatButton Content="{DynamicResource Icon.ArrowRight}"
|
|
|
|
|
+ Style="{StaticResource ScrollBarButton}"
|
|
|
|
|
+ IsTabStop="False" Interval="50"
|
|
|
|
|
+ Command="ScrollBar.LineRightCommand"/>
|
|
|
|
|
+ </Border>
|
|
|
|
|
+ </Grid>
|
|
|
|
|
+ <ControlTemplate.Triggers>
|
|
|
|
|
+ <Trigger Property="IsMouseOver" Value="true">
|
|
|
|
|
+ <Setter TargetName="BgInner" Property="Opacity" Value="0.5"/>
|
|
|
|
|
+ </Trigger>
|
|
|
|
|
+ </ControlTemplate.Triggers>
|
|
|
|
|
+ </ControlTemplate>
|
|
|
|
|
+ <!--垂直滚滚动条模板-->
|
|
|
|
|
+ <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
|
|
|
|
|
+ <Grid x:Name="VerticalRoot" Height="{TemplateBinding Height}">
|
|
|
|
|
+ <Grid.RowDefinitions>
|
|
|
|
|
+ <RowDefinition Height="Auto" />
|
|
|
|
|
+ <RowDefinition Height="*" />
|
|
|
|
|
+ <RowDefinition Height="Auto" />
|
|
|
|
|
+ </Grid.RowDefinitions>
|
|
|
|
|
+ <!--内部背景-->
|
|
|
|
|
+ <Border x:Name="BgInner" Grid.Row="1" Margin="0" CornerRadius="6" SnapsToDevicePixels ="True"
|
|
|
|
|
+ Background="#CCCCCC"/>
|
|
|
|
|
+ <!--上按钮-->
|
|
|
|
|
+ <Border Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center" x:Name="VerticalSmallDecrease">
|
|
|
|
|
+ <RepeatButton Content="{DynamicResource arrowUp}"
|
|
|
|
|
+ Style="{StaticResource ScrollBarButton}"
|
|
|
|
|
+ IsTabStop="False" Interval="50" Margin="0"
|
|
|
|
|
+ Command="ScrollBar.LineUpCommand"/>
|
|
|
|
|
+ </Border>
|
|
|
|
|
+ <!--中间滑动区域-->
|
|
|
|
|
+ <Track x:Name="PART_Track" IsDirectionReversed="true" Grid.Row="1">
|
|
|
|
|
+ <!--上滑块-->
|
|
|
|
|
+ <Track.DecreaseRepeatButton>
|
|
|
|
|
+ <RepeatButton x:Name="HorizontalLargeDecrease"
|
|
|
|
|
+ Command="ScrollBar.PageUpCommand"
|
|
|
|
|
+ IsTabStop="False" Interval="50"
|
|
|
|
|
+ Style="{StaticResource ScrollBarTrackButton}" />
|
|
|
|
|
+ </Track.DecreaseRepeatButton>
|
|
|
|
|
+ <!--中间滑块-->
|
|
|
|
|
+ <Track.Thumb>
|
|
|
|
|
+ <Thumb Template="{StaticResource ThumbTemplate}" MinHeight="10"/>
|
|
|
|
|
+ </Track.Thumb>
|
|
|
|
|
+ <!--下滑块-->
|
|
|
|
|
+ <Track.IncreaseRepeatButton>
|
|
|
|
|
+ <RepeatButton x:Name="HorizontalLargeIncrease" Command="ScrollBar.PageDownCommand"
|
|
|
|
|
+ IsTabStop="False" Interval="50" Style="{StaticResource ScrollBarTrackButton}" />
|
|
|
|
|
+ </Track.IncreaseRepeatButton>
|
|
|
|
|
+ </Track>
|
|
|
|
|
+ <!--下按钮-->
|
|
|
|
|
+ <Border Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Center" x:Name="VerticalSmallIncrease">
|
|
|
|
|
+ <RepeatButton Content="{DynamicResource arrowDown}"
|
|
|
|
|
+ Style="{StaticResource ScrollBarButton}"
|
|
|
|
|
+ IsTabStop="False" Interval="50" Margin="0"
|
|
|
|
|
+ Command="ScrollBar.LineDownCommand"/>
|
|
|
|
|
+ </Border>
|
|
|
|
|
+ </Grid>
|
|
|
|
|
+ <ControlTemplate.Triggers>
|
|
|
|
|
+ <Trigger Property="IsMouseOver" Value="true">
|
|
|
|
|
+ <Setter TargetName="BgInner" Property="Opacity" Value="0.5"/>
|
|
|
|
|
+ </Trigger>
|
|
|
|
|
+ </ControlTemplate.Triggers>
|
|
|
|
|
+ </ControlTemplate>
|
|
|
|
|
+ <!--ScrollBar样式-->
|
|
|
|
|
+ <Style x:Key="DefaultScrollBar" TargetType="{x:Type ScrollBar}">
|
|
|
|
|
+ <Setter Property="SnapsToDevicePixels" Value="True" />
|
|
|
|
|
+ <Setter Property="OverridesDefaultStyle" Value="true" />
|
|
|
|
|
+ <Style.Triggers>
|
|
|
|
|
+ <Trigger Property="Orientation" Value="Horizontal">
|
|
|
|
|
+ <Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
|
|
|
|
|
+ <Setter Property="Height" Value="12" />
|
|
|
|
|
+ </Trigger>
|
|
|
|
|
+ <Trigger Property="Orientation" Value="Vertical">
|
|
|
|
|
+ <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
|
|
|
|
|
+ <Setter Property="Width" Value="12" />
|
|
|
|
|
+ </Trigger>
|
|
|
|
|
+ </Style.Triggers>
|
|
|
|
|
+ </Style>
|
|
|
|
|
+ <!--ScrollViewer样式-->
|
|
|
|
|
+ <Style x:Key="ScrollViewer.Default" TargetType="{x:Type ScrollViewer}">
|
|
|
|
|
+ <Setter Property="HorizontalScrollBarVisibility" Value="Auto"/>
|
|
|
|
|
+ <Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
|
|
|
|
|
+ <Setter Property="Template">
|
|
|
|
|
+ <Setter.Value>
|
|
|
|
|
+ <ControlTemplate TargetType="{x:Type ScrollViewer}">
|
|
|
|
|
+ <Grid x:Name="Grid" Background="{TemplateBinding Background}">
|
|
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
|
|
+ <ColumnDefinition Width="*" x:Name="leftColumn" />
|
|
|
|
|
+ <ColumnDefinition Width="Auto" x:Name="rightColumn" />
|
|
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
|
|
+ <Grid.RowDefinitions>
|
|
|
|
|
+ <RowDefinition Height="*" />
|
|
|
|
|
+ <RowDefinition Height="Auto" />
|
|
|
|
|
+ </Grid.RowDefinitions>
|
|
|
|
|
+ <ScrollContentPresenter x:Name="PART_ContentHost" CanContentScroll="{TemplateBinding CanContentScroll}"
|
|
|
|
|
+ CanHorizontallyScroll="False" CanVerticallyScroll="False"
|
|
|
|
|
+ ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
|
|
|
+ Content="{TemplateBinding Content}" Margin="{TemplateBinding Padding}"
|
|
|
|
|
+ Grid.Row="0" Grid.Column="0" />
|
|
|
|
|
+ <!--<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}"
|
|
|
|
|
+ CanHorizontallyScroll="False" CanVerticallyScroll="False"
|
|
|
|
|
+ ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
|
|
|
+ Content="{TemplateBinding Content}" Margin="{TemplateBinding Padding}"
|
|
|
|
|
+ Grid.Row="0" Grid.Column="0" />-->
|
|
|
|
|
+ <!--垂直滚动条 -->
|
|
|
|
|
+ <ScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar"
|
|
|
|
|
+ ViewportSize="{TemplateBinding ViewportHeight}"
|
|
|
|
|
+ Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}"
|
|
|
|
|
+ Minimum="0" Grid.Row="0"
|
|
|
|
|
+ Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
|
|
|
|
|
+ Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
|
|
|
|
|
+ Style="{DynamicResource DefaultScrollBar}"/>
|
|
|
|
|
+ <!--水平底部滚动条-->
|
|
|
|
|
+ <ScrollBar x:Name="PART_HorizontalScrollBar"
|
|
|
|
|
+ AutomationProperties.AutomationId="HorizontalScrollBar"
|
|
|
|
|
+ Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}"
|
|
|
|
|
+ Minimum="0" Orientation="Horizontal" Grid.Row="1"
|
|
|
|
|
+ Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
|
|
|
|
|
+ Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
|
|
|
|
|
+ ViewportSize="{TemplateBinding ViewportWidth}"
|
|
|
|
|
+ Style="{DynamicResource DefaultScrollBar}"/>
|
|
|
|
|
+ </Grid>
|
|
|
|
|
+ </ControlTemplate>
|
|
|
|
|
+ </Setter.Value>
|
|
|
|
|
+ </Setter>
|
|
|
|
|
+ </Style>
|
|
|
|
|
+</ResourceDictionary>
|