|
42 | 42 | </Style> |
43 | 43 |
|
44 | 44 | <!--Scrollbar Thumbs--> |
45 | | - <Style x:Key="ScrollThumbs" TargetType="{x:Type Thumb}"> |
| 45 | + <Style x:Key="VerticalScrollThumbs" TargetType="{x:Type Thumb}"> |
46 | 46 | <Setter Property="Template"> |
47 | 47 | <Setter.Value> |
48 | 48 | <ControlTemplate TargetType="{x:Type Thumb}"> |
49 | 49 | <Grid x:Name="Grid"> |
50 | 50 | <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Fill="Transparent"/> |
51 | | - <Border x:Name="Rectangle1" CornerRadius="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Background="{TemplateBinding Background}"/> |
| 51 | + <Border x:Name="Rectangle1" CornerRadius="5" HorizontalAlignment="Stretch" |
| 52 | + VerticalAlignment="Stretch" Width="Auto" Height="Auto" Background="{TemplateBinding Background}"/> |
| 53 | + </Grid> |
| 54 | + <ControlTemplate.Triggers> |
| 55 | + <Trigger Property="Tag" Value="Horizontal"> |
| 56 | + <Setter TargetName="Rectangle1" Property="Width" Value="Auto"/> |
| 57 | + <Setter TargetName="Rectangle1" Property="Height" Value="7"/> |
| 58 | + </Trigger> |
| 59 | + </ControlTemplate.Triggers> |
| 60 | + </ControlTemplate> |
| 61 | + </Setter.Value> |
| 62 | + </Setter> |
| 63 | + </Style> |
| 64 | + |
| 65 | + <Style x:Key="HorizontalScrollThumbs" TargetType="{x:Type Thumb}"> |
| 66 | + <Setter Property="Template"> |
| 67 | + <Setter.Value> |
| 68 | + <ControlTemplate TargetType="{x:Type Thumb}"> |
| 69 | + <Grid x:Name="Grid"> |
| 70 | + <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Fill="Transparent"/> |
| 71 | + <Border x:Name="Rectangle1" CornerRadius="5" HorizontalAlignment="Stretch" |
| 72 | + VerticalAlignment="Stretch" Width="Auto" Height="Auto" Background="{TemplateBinding Background}"/> |
52 | 73 | </Grid> |
53 | 74 | <ControlTemplate.Triggers> |
54 | 75 | <Trigger Property="Tag" Value="Horizontal"> |
|
62 | 83 | </Style> |
63 | 84 |
|
64 | 85 | <!--ScrollBars--> |
65 | | - <Style x:Key="ScrollBarStyle" TargetType="{x:Type ScrollBar}"> |
| 86 | + <Style x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}"> |
66 | 87 | <Setter Property="Foreground" Value="#8C8C8C"/> |
67 | 88 | <Setter Property="Background" Value="Transparent"/> |
68 | 89 | <Setter Property="Width" Value="8"/> |
|
76 | 97 |
|
77 | 98 | <Track x:Name="PART_Track" Grid.Row="0" IsDirectionReversed="true" Focusable="false"> |
78 | 99 | <Track.Thumb> |
79 | | - <Thumb x:Name="Thumb" Background="{TemplateBinding Foreground}" Style="{StaticResource ScrollThumbs}"/> |
| 100 | + <Thumb x:Name="Thumb" Background="{TemplateBinding Foreground}" Style="{StaticResource VerticalScrollThumbs}"/> |
80 | 101 | </Track.Thumb> |
81 | 102 | <Track.IncreaseRepeatButton> |
82 | 103 | <RepeatButton x:Name="PageUp" Command="ScrollBar.PageDownCommand" Opacity="0" Focusable="false"/> |
|
102 | 123 | <RotateTransform Angle="-90"/> |
103 | 124 | </Setter.Value> |
104 | 125 | </Setter> |
105 | | - <Setter Property="Width" Value="Auto"/> |
106 | | - <Setter Property="Height" Value="8"/> |
| 126 | + <Setter Property="Width" Value="8"/> |
| 127 | + <Setter Property="Height" Value="Auto"/> |
107 | 128 | <Setter TargetName="Thumb" Property="Tag" Value="Horizontal"/> |
108 | 129 | <Setter TargetName="PageDown" Property="Command" Value="ScrollBar.PageLeftCommand"/> |
109 | 130 | <Setter TargetName="PageUp" Property="Command" Value="ScrollBar.PageRightCommand"/> |
|
114 | 135 | </Setter> |
115 | 136 | </Style> |
116 | 137 |
|
| 138 | + <Style x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}"> |
| 139 | + <Setter Property="Foreground" Value="#8C8C8C"/> |
| 140 | + <Setter Property="Background" Value="Transparent"/> |
| 141 | + <Setter Property="Height" Value="8"/> |
| 142 | + <Setter Property="Template"> |
| 143 | + <Setter.Value> |
| 144 | + <ControlTemplate TargetType="{x:Type ScrollBar}"> |
| 145 | + <Grid x:Name="GridRoot" Height="8" Background="{TemplateBinding Background}"> |
| 146 | + <Grid.ColumnDefinitions> |
| 147 | + <ColumnDefinition Width="0.00001*"/> |
| 148 | + </Grid.ColumnDefinitions> |
| 149 | + |
| 150 | + <Track x:Name="PART_Track" Grid.Column="0" IsDirectionReversed="true" Focusable="false"> |
| 151 | + <Track.Thumb> |
| 152 | + <Thumb x:Name="Thumb" Background="{TemplateBinding Foreground}" Style="{StaticResource HorizontalScrollThumbs}"/> |
| 153 | + </Track.Thumb> |
| 154 | + <Track.IncreaseRepeatButton> |
| 155 | + <RepeatButton x:Name="PageRight" Command="ScrollBar.PageRightCommand" Opacity="0" Focusable="false"/> |
| 156 | + </Track.IncreaseRepeatButton> |
| 157 | + <Track.DecreaseRepeatButton> |
| 158 | + <RepeatButton x:Name="PageLeft" Command="ScrollBar.PageLeftCommand" Opacity="0" Focusable="false"/> |
| 159 | + </Track.DecreaseRepeatButton> |
| 160 | + </Track> |
| 161 | + </Grid> |
| 162 | + |
| 163 | + <ControlTemplate.Triggers> |
| 164 | + <Trigger Property="IsEnabled" Value="false"> |
| 165 | + <Setter TargetName="Thumb" Property="Visibility" Value="Collapsed"/> |
| 166 | + </Trigger> |
| 167 | + <Trigger Property="Orientation" Value="Horizontal"> |
| 168 | + <Setter TargetName="GridRoot" Property="LayoutTransform"> |
| 169 | + <Setter.Value> |
| 170 | + <RotateTransform Angle="-90"/> |
| 171 | + </Setter.Value> |
| 172 | + </Setter> |
| 173 | + <Setter TargetName="PART_Track" Property="LayoutTransform"> |
| 174 | + <Setter.Value> |
| 175 | + <RotateTransform Angle="-90"/> |
| 176 | + </Setter.Value> |
| 177 | + </Setter> |
| 178 | + <Setter Property="Width" Value="Auto"/> |
| 179 | + <Setter Property="Height" Value="8"/> |
| 180 | + <Setter TargetName="Thumb" Property="Tag" Value="Horizontal"/> |
| 181 | + <Setter TargetName="PageLeft" Property="Command" Value="ScrollBar.PageLeftCommand"/> |
| 182 | + <Setter TargetName="PageRight" Property="Command" Value="ScrollBar.PageRightCommand"/> |
| 183 | + </Trigger> |
| 184 | + </ControlTemplate.Triggers> |
| 185 | + </ControlTemplate> |
| 186 | + </Setter.Value> |
| 187 | + </Setter> |
| 188 | + </Style> |
| 189 | + |
117 | 190 | <!-- ScrollViewer --> |
118 | 191 | <Style x:Key="ScrollViewerStyle" TargetType="{x:Type ScrollViewer}"> |
119 | 192 | <Setter Property="OverridesDefaultStyle" Value="True"/> |
| 193 | + <Setter Property="FlowDirection" Value="LeftToRight"/> |
120 | 194 | <Setter Property="Template"> |
121 | 195 | <Setter.Value> |
122 | 196 | <ControlTemplate TargetType="{x:Type ScrollViewer}"> |
123 | 197 | <Grid> |
124 | 198 | <Grid.ColumnDefinitions> |
125 | | - <ColumnDefinition Width="16"/> |
126 | 199 | <ColumnDefinition /> |
127 | 200 | <ColumnDefinition Width="16"/> |
128 | 201 | </Grid.ColumnDefinitions> |
129 | 202 | <Grid.RowDefinitions> |
130 | 203 | <RowDefinition /> |
| 204 | + <RowDefinition Height="16"/> |
131 | 205 | </Grid.RowDefinitions> |
132 | | - <ScrollContentPresenter Grid.ColumnSpan="3" /> |
133 | | - <ScrollBar x:Name="PART_VerticalScrollBar" Grid.Column="2" Value="{TemplateBinding VerticalOffset}" Maximum="{TemplateBinding ScrollableHeight}" ViewportSize="{TemplateBinding ViewportHeight}" Style="{DynamicResource ScrollBarStyle}" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/> |
| 206 | + <ScrollContentPresenter Grid.ColumnSpan="3"/> |
| 207 | + <ScrollBar x:Name="PART_VerticalScrollBar" Grid.Column="1" Value="{TemplateBinding VerticalOffset}" |
| 208 | + Maximum="{TemplateBinding ScrollableHeight}" ViewportSize="{TemplateBinding ViewportHeight}" |
| 209 | + Style="{DynamicResource VerticalScrollBar}" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/> |
| 210 | + |
| 211 | + <ScrollBar x:Name="PART_HorizontalScrollBar" Grid.Row="1" Value="{TemplateBinding HorizontalOffset}" |
| 212 | + Maximum="{TemplateBinding ScrollableWidth}" ViewportSize="{TemplateBinding ViewportWidth}" |
| 213 | + Style="{DynamicResource HorizontalScrollBar}" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/> |
134 | 214 | </Grid> |
135 | 215 | </ControlTemplate> |
136 | 216 | </Setter.Value> |
|
0 commit comments