|
| 1 | +<Application x:Class="IconConverterSample.App" |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:local="clr-namespace:IconConverterSample" |
| 5 | + StartupUri="MainWindow.xaml"> |
| 6 | + <Application.Resources> |
| 7 | + <Style x:Key="ScrollBarTrackThumb" |
| 8 | + TargetType="{x:Type Thumb}"> |
| 9 | + <Setter Property="Template"> |
| 10 | + <Setter.Value> |
| 11 | + <ControlTemplate TargetType="{x:Type Thumb}"> |
| 12 | + <Grid x:Name="Grid"> |
| 13 | + <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Fill="Transparent" /> |
| 14 | + <Border x:Name="CornerScrollBarRectangle" CornerRadius="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" |
| 15 | + Width="Auto" Height="Auto" Margin="0,1,0,1" Background="{TemplateBinding Background}" /> |
| 16 | + </Grid> |
| 17 | + <ControlTemplate.Triggers> |
| 18 | + <Trigger Property="Tag" Value="Horizontal"> |
| 19 | + <Setter TargetName="CornerScrollBarRectangle" Property="Width" Value="Auto" /> |
| 20 | + <Setter TargetName="CornerScrollBarRectangle" Property="Height" Value="8" /> |
| 21 | + </Trigger> |
| 22 | + </ControlTemplate.Triggers> |
| 23 | + </ControlTemplate> |
| 24 | + </Setter.Value> |
| 25 | + </Setter> |
| 26 | + </Style> |
| 27 | + <Style TargetType="{x:Type ScrollBar}"> |
| 28 | + <Setter Property="Stylus.IsFlicksEnabled" Value="false" /> |
| 29 | + <Setter Property="Foreground" Value="DeepSkyBlue" /> |
| 30 | + <Setter Property="Background" Value="Transparent" /> |
| 31 | + <Setter Property="Width" Value="9" /> |
| 32 | + <Setter Property="Template"> |
| 33 | + <Setter.Value> |
| 34 | + <ControlTemplate TargetType="{x:Type ScrollBar}"> |
| 35 | + <Grid x:Name="GridRoot" Width="9" Background="{TemplateBinding Background}"> |
| 36 | + <Grid.RowDefinitions> |
| 37 | + <RowDefinition Height="0.00001*" /> |
| 38 | + </Grid.RowDefinitions> |
| 39 | + <Track x:Name="PART_Track" Grid.Row="0" IsDirectionReversed="true" Focusable="false"> |
| 40 | + <Track.Thumb> |
| 41 | + <Thumb x:Name="Thumb" Background="{TemplateBinding Foreground}" Style="{DynamicResource ScrollBarTrackThumb}" /> |
| 42 | + </Track.Thumb> |
| 43 | + <Track.IncreaseRepeatButton> |
| 44 | + <RepeatButton x:Name="PageUp" Command="ScrollBar.PageDownCommand" Opacity="0" Focusable="false" /> |
| 45 | + </Track.IncreaseRepeatButton> |
| 46 | + <Track.DecreaseRepeatButton> |
| 47 | + <RepeatButton x:Name="PageDown" Command="ScrollBar.PageUpCommand" Opacity="0" Focusable="false" /> |
| 48 | + </Track.DecreaseRepeatButton> |
| 49 | + </Track> |
| 50 | + </Grid> |
| 51 | + <ControlTemplate.Triggers> |
| 52 | + <Trigger SourceName="Thumb" Property="IsMouseOver" Value="true"> |
| 53 | + <Setter Value="{DynamicResource ButtonSelectBrush}" TargetName="Thumb" Property="Background" /> |
| 54 | + </Trigger> |
| 55 | + <Trigger SourceName="Thumb" Property="IsDragging" Value="true"> |
| 56 | + <Setter Value="{DynamicResource DarkBrush}" TargetName="Thumb" Property="Background" /> |
| 57 | + </Trigger> |
| 58 | + |
| 59 | + <Trigger Property="IsEnabled" Value="false"> |
| 60 | + <Setter TargetName="Thumb" Property="Visibility" Value="Collapsed" /> |
| 61 | + </Trigger> |
| 62 | + <Trigger Property="Orientation" Value="Horizontal"> |
| 63 | + <Setter TargetName="GridRoot" Property="LayoutTransform"> |
| 64 | + <Setter.Value> |
| 65 | + <RotateTransform Angle="-90" /> |
| 66 | + </Setter.Value> |
| 67 | + </Setter> |
| 68 | + <Setter TargetName="PART_Track" Property="LayoutTransform"> |
| 69 | + <Setter.Value> |
| 70 | + <RotateTransform Angle="-90" /> |
| 71 | + </Setter.Value> |
| 72 | + </Setter> |
| 73 | + <Setter Property="Width" Value="Auto" /> |
| 74 | + <Setter Property="Height" Value="9" /> |
| 75 | + <Setter TargetName="Thumb" Property="Tag" Value="Horizontal" /> |
| 76 | + <Setter TargetName="PageDown" Property="Command" Value="ScrollBar.PageLeftCommand" /> |
| 77 | + <Setter TargetName="PageUp" Property="Command" Value="ScrollBar.PageRightCommand" /> |
| 78 | + </Trigger> |
| 79 | + </ControlTemplate.Triggers> |
| 80 | + </ControlTemplate> |
| 81 | + </Setter.Value> |
| 82 | + </Setter> |
| 83 | + </Style> |
| 84 | + </Application.Resources> |
| 85 | +</Application> |
0 commit comments