| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
- <Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}">
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="OverridesDefaultStyle" Value="true" />
- <Setter Property="Focusable" Value="false" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RepeatButton}">
- <Border Name="Border"
- Margin="0"
- Background="{DynamicResource ScrollButtonBrush}"
- BorderBrush="{DynamicResource CommonBorderBrush}"
- BorderThickness="1"
- CornerRadius="0">
- <Path Name="Path"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="{Binding Path=Content,
- RelativeSource={RelativeSource TemplatedParent}}"
- Fill="{DynamicResource ScrollBarFill}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsPressed" Value="true">
- <!-- <Setter TargetName="Border" Property="Background" Value="{DynamicResource PressedBrush}" /> -->
- <Setter TargetName="Path" Property="Fill" Value="{DynamicResource ButtonPressBrush}" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Foreground" Value="{DynamicResource ButtonDisEnableColor}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="OverridesDefaultStyle" Value="true" />
- <Setter Property="IsTabStop" Value="false" />
- <Setter Property="Focusable" Value="false" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RepeatButton}">
- <Border Background="Transparent"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="OverridesDefaultStyle" Value="true" />
- <Setter Property="BorderBrush" Value="{DynamicResource CommonBorderBrush}" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="Background" Value="{DynamicResource ScrollThumbBackground}" />
- <Setter Property="IsTabStop" Value="false" />
- <Setter Property="Focusable" Value="false" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Thumb}">
- <Border Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="0" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition MaxHeight="18" />
- <RowDefinition Height="0.00001*" />
- <RowDefinition MaxHeight="18" />
- </Grid.RowDefinitions>
- <Border Grid.RowSpan="3"
- Background="{DynamicResource ScrollBackground}"
- CornerRadius="0" />
- <RepeatButton Grid.Row="0"
- Height="18"
- Command="ScrollBar.LineUpCommand"
- Content="M 0 4 L 8 4 L 4 0 Z"
- Style="{DynamicResource ScrollBarLineButton}" />
- <Track Name="PART_Track"
- Grid.Row="1"
- Margin="1,0"
- IsDirectionReversed="true">
- <Track.DecreaseRepeatButton>
- <RepeatButton Command="ScrollBar.PageUpCommand" Style="{DynamicResource ScrollBarPageButton}" />
- </Track.DecreaseRepeatButton>
- <Track.Thumb>
- <Thumb Margin="0,0,0,0"
- Background="{DynamicResource ScrollThumbBackground}"
- Style="{DynamicResource ScrollBarThumb}" />
- </Track.Thumb>
- <Track.IncreaseRepeatButton>
- <RepeatButton Command="ScrollBar.PageDownCommand" Style="{DynamicResource ScrollBarPageButton}" />
- </Track.IncreaseRepeatButton>
- </Track>
- <RepeatButton Grid.Row="2"
- Height="18"
- Command="ScrollBar.LineDownCommand"
- Content="M 0 0 L 4 4 L 8 0 Z"
- Style="{DynamicResource ScrollBarLineButton}" />
- </Grid>
- </ControlTemplate>
- <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition MaxWidth="18" />
- <ColumnDefinition Width="0.00001*" />
- <ColumnDefinition MaxWidth="18" />
- </Grid.ColumnDefinitions>
- <Border Grid.ColumnSpan="3"
- Background="{DynamicResource ScrollBackground}"
- CornerRadius="0" />
- <RepeatButton Grid.Column="0"
- Width="18"
- Command="ScrollBar.LineLeftCommand"
- Content="M 4 0 L 4 8 L 0 4 Z"
- Style="{DynamicResource ScrollBarLineButton}" />
- <Track Name="PART_Track"
- Grid.Column="1"
- Margin="0,1"
- IsDirectionReversed="False">
- <Track.DecreaseRepeatButton>
- <RepeatButton Command="ScrollBar.PageLeftCommand" Style="{DynamicResource ScrollBarPageButton}" />
- </Track.DecreaseRepeatButton>
- <Track.Thumb>
- <Thumb Margin="0,0,0,0" Style="{DynamicResource ScrollBarThumb}" />
- </Track.Thumb>
- <Track.IncreaseRepeatButton>
- <RepeatButton Command="ScrollBar.PageRightCommand" Style="{DynamicResource ScrollBarPageButton}" />
- </Track.IncreaseRepeatButton>
- </Track>
- <RepeatButton Grid.Column="3"
- Width="18"
- Command="ScrollBar.LineRightCommand"
- Content="M 0 0 L 4 4 L 0 8 Z"
- Style="{DynamicResource ScrollBarLineButton}" />
- </Grid>
- </ControlTemplate>
- <Style TargetType="{x:Type ScrollBar}">
- <Setter Property="Background" Value="{DynamicResource ScrollBackground}" />
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="OverridesDefaultStyle" Value="true" />
- <Style.Triggers>
- <Trigger Property="Orientation" Value="Horizontal">
- <Setter Property="Width" Value="Auto" />
- <Setter Property="Height" Value="18" />
- <Setter Property="Template" Value="{DynamicResource HorizontalScrollBar}" />
- </Trigger>
- <Trigger Property="Orientation" Value="Vertical">
- <Setter Property="Width" Value="18" />
- <Setter Property="Height" Value="Auto" />
- <Setter Property="Template" Value="{DynamicResource VerticalScrollBar}" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style TargetType="{x:Type ScrollViewer}">
- <Setter Property="Background" Value="{DynamicResource ScrollBackground}" />
- <Setter Property="OverridesDefaultStyle" Value="True" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ScrollViewer}">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="auto" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- <RowDefinition Height="auto" />
- </Grid.RowDefinitions>
- <ScrollContentPresenter Grid.Row="0" Grid.Column="0" />
- <ScrollBar Name="PART_VerticalScrollBar"
- Grid.Column="1"
- Background="{TemplateBinding Background}"
- Maximum="{TemplateBinding ScrollableHeight}"
- ViewportSize="{TemplateBinding ViewportHeight}"
- Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
- Value="{TemplateBinding VerticalOffset}" />
- <ScrollBar Name="PART_HorizontalScrollBar"
- Grid.Row="1"
- Background="{TemplateBinding Background}"
- Maximum="{TemplateBinding ScrollableWidth}"
- Orientation="Horizontal"
- ViewportSize="{TemplateBinding ViewportWidth}"
- Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
- Value="{TemplateBinding HorizontalOffset}" />
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="HorizontalMarketScrollBar" TargetType="{x:Type ScrollBar}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ScrollBar}">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="20" />
- <ColumnDefinition Width=" 1*" />
- <ColumnDefinition MaxWidth="20" />
- </Grid.ColumnDefinitions>
- <Border Grid.ColumnSpan="3"
- Background="{DynamicResource ScrollBackground}"
- CornerRadius="0" />
- <RepeatButton Grid.Column="0"
- Width="18"
- Command="ScrollBar.LineLeftCommand"
- Content="M 4 0 L 4 8 L 0 4 Z"
- Style="{DynamicResource ScrollBarLineButton}" />
- <Track Name="PART_Track"
- Grid.Column="1"
- Margin="0,1"
- IsDirectionReversed="False"
- Visibility="Collapsed">
- <Track.DecreaseRepeatButton>
- <RepeatButton Command="ScrollBar.PageLeftCommand" Style="{DynamicResource ScrollBarPageButton}" />
- </Track.DecreaseRepeatButton>
- <Track.Thumb>
- <Thumb Margin="0,0,0,0"
- BorderBrush="{DynamicResource CommonBorderBrush}"
- Style="{DynamicResource ScrollBarThumb}" />
- </Track.Thumb>
- <Track.IncreaseRepeatButton>
- <RepeatButton Command="ScrollBar.PageRightCommand" Style="{DynamicResource ScrollBarPageButton}" />
- </Track.IncreaseRepeatButton>
- </Track>
- <RepeatButton Grid.Column="2"
- Width="18"
- Command="ScrollBar.LineRightCommand"
- Content="M 0 0 L 4 4 L 0 8 Z"
- Style="{DynamicResource ScrollBarLineButton}" />
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="QuoteMarketStyle" TargetType="{x:Type ScrollViewer}">
- <Setter Property="OverridesDefaultStyle" Value="True" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ScrollViewer}">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- <RowDefinition Height="auto" />
- </Grid.RowDefinitions>
- <!-- 占位Rectangle -->
- <Rectangle Grid.Column="0"
- Width="20"
- Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" />
- <Rectangle Grid.Column="2"
- Width="20"
- Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" />
- <ScrollBar Name="PART_VerticalScrollBar"
- Grid.Column="1"
- Maximum="{TemplateBinding ScrollableHeight}"
- ViewportSize="{TemplateBinding ViewportHeight}"
- Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
- Value="{TemplateBinding VerticalOffset}" />
- <ScrollBar Name="PART_HorizontalScrollBar"
- Grid.Column="0"
- Grid.ColumnSpan="3"
- Height="{TemplateBinding Height}"
- Maximum="{TemplateBinding ScrollableWidth}"
- Orientation="Horizontal"
- Style="{DynamicResource HorizontalMarketScrollBar}"
- ViewportSize="{TemplateBinding ViewportWidth}"
- Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
- Value="{TemplateBinding HorizontalOffset}" />
- <ScrollContentPresenter Grid.Row="0" Grid.Column="1" />
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|