Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
- <!--
- Define The VerticalScrollBar Thumb Style
- -->
- <Style x:Key="VerticalScrollBarThumbStyle" TargetType="{x:Type Thumb}">
- <Setter Property="IsTabStop" Value="False" />
- <Setter Property="Focusable" Value="False" />
- <Setter Property="Margin" Value="0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Thumb}">
- <Rectangle
- Name="ellipse"
- Width="10"
- Fill="#575757"
- RadiusX="5"
- RadiusY="5"
- Stroke="Transparent" />
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="ellipse" Property="Fill" Value="#808080" />
- </Trigger>
- <Trigger Property="IsDragging" Value="True">
- <Setter TargetName="ellipse" Property="Fill" Value="#808080" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--
- Define The HorizontalScrollBar Thumb Style
- -->
- <Style x:Key="HorizontalScrollBarThumbStyle" TargetType="{x:Type Thumb}">
- <Setter Property="IsTabStop" Value="False" />
- <Setter Property="Focusable" Value="False" />
- <Setter Property="Margin" Value="0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Thumb}">
- <Rectangle
- Name="ellipse"
- Height="10"
- Fill="#575757"
- RadiusX="5"
- RadiusY="5"
- Stroke="Transparent" />
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="ellipse" Property="Fill" Value="#808080" />
- </Trigger>
- <Trigger Property="IsDragging" Value="True">
- <Setter TargetName="ellipse" Property="Fill" Value="#808080" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--
- Define The Button Up Style
- -->
- <Style x:Key="ButtonUpStyle" TargetType="{x:Type RepeatButton}">
- <Setter Property="Focusable" Value="False" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RepeatButton}">
- <Grid Height="18" Margin="1">
- <Path
- Name="Path"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M 0 8 L 8 8 L 4 0 Z"
- Fill="{DynamicResource GlobalAccentSolidColorBrush}"
- Stretch="None" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="Path" Property="Fill" Value="{DynamicResource GlobalAccentFeedbackSolidColorBrush}" />
- </Trigger>
- <Trigger Property="IsPressed" Value="true">
- <Setter TargetName="Path" Property="Fill" Value="{DynamicResource GlobalAccentFeedbackSolidColorBrush}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--
- Define The Button Down Style
- -->
- <Style x:Key="ButtonDownStyle" TargetType="{x:Type RepeatButton}">
- <Setter Property="Focusable" Value="False" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RepeatButton}">
- <Grid Height="18" Margin="1">
- <Path
- Name="Path"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M 0 0 L 4 8 L 8 0 Z"
- Fill="{DynamicResource GlobalAccentSolidColorBrush}"
- Stretch="None" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="Path" Property="Fill" Value="{DynamicResource GlobalAccentFeedbackSolidColorBrush}" />
- </Trigger>
- <Trigger Property="IsPressed" Value="true">
- <Setter TargetName="Path" Property="Fill" Value="{DynamicResource GlobalAccentFeedbackSolidColorBrush}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--
- Define The Button Left Style
- -->
- <Style x:Key="ButtonLeftStyle" TargetType="{x:Type RepeatButton}">
- <Setter Property="Focusable" Value="False" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RepeatButton}">
- <Grid Width="18" Margin="1">
- <Path
- Name="Path"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M 0 0 L -8 4 L 0 8 Z"
- Fill="{DynamicResource GlobalAccentSolidColorBrush}"
- Stretch="None" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="Path" Property="Fill" Value="{DynamicResource GlobalAccentFeedbackSolidColorBrush}" />
- </Trigger>
- <Trigger Property="IsPressed" Value="true">
- <Setter TargetName="Path" Property="Fill" Value="{DynamicResource GlobalAccentFeedbackSolidColorBrush}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--
- Define The Button Right Style
- -->
- <Style x:Key="ButtonRightStyle" TargetType="{x:Type RepeatButton}">
- <Setter Property="Focusable" Value="False" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RepeatButton}">
- <Grid Width="18" Margin="1">
- <Path
- Name="Path"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M 0 0 L 8 4 L 0 8 Z"
- Fill="{DynamicResource GlobalAccentSolidColorBrush}"
- Stretch="None" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="Path" Property="Fill" Value="{DynamicResource GlobalAccentFeedbackSolidColorBrush}" />
- </Trigger>
- <Trigger Property="IsPressed" Value="true">
- <Setter TargetName="Path" Property="Fill" Value="{DynamicResource GlobalAccentFeedbackSolidColorBrush}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--
- Define The ScrollBarPageButton Style
- -->
- <Style x:Key="ScrollBarPageButtonStyle" TargetType="{x:Type RepeatButton}">
- <Setter Property="IsTabStop" Value="False" />
- <Setter Property="Focusable" Value="False" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RepeatButton}">
- <Border Background="Transparent" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--
- Override The VerticalScrollBar Template
- -->
- <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition MaxHeight="0" />
- <RowDefinition Height="*" />
- <RowDefinition MaxHeight="0" />
- </Grid.RowDefinitions>
- <Grid.Background>
- <SolidColorBrush Color="Transparent" />
- </Grid.Background>
- <Track
- Name="PART_Track"
- Grid.Row="1"
- IsDirectionReversed="True">
- <Track.DecreaseRepeatButton>
- <RepeatButton Command="ScrollBar.PageUpCommand" Style="{StaticResource ScrollBarPageButtonStyle}" />
- </Track.DecreaseRepeatButton>
- <Track.Thumb>
- <Thumb Style="{StaticResource VerticalScrollBarThumbStyle}" />
- </Track.Thumb>
- <Track.IncreaseRepeatButton>
- <RepeatButton Command="ScrollBar.PageDownCommand" Style="{StaticResource ScrollBarPageButtonStyle}" />
- </Track.IncreaseRepeatButton>
- </Track>
- </Grid>
- </ControlTemplate>
- <!--
- Override The HorizontalScrollBar Template
- -->
- <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition MaxWidth="0" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition MaxWidth="0" />
- </Grid.ColumnDefinitions>
- <Grid.Background>
- <SolidColorBrush Color="Transparent" />
- </Grid.Background>
- <Track
- Name="PART_Track"
- Grid.Column="1"
- IsDirectionReversed="False">
- <Track.DecreaseRepeatButton>
- <RepeatButton Command="ScrollBar.PageLeftCommand" Style="{StaticResource ScrollBarPageButtonStyle}" />
- </Track.DecreaseRepeatButton>
- <Track.Thumb>
- <Thumb Style="{StaticResource HorizontalScrollBarThumbStyle}" />
- </Track.Thumb>
- <Track.IncreaseRepeatButton>
- <RepeatButton Command="ScrollBar.PageRightCommand" Style="{StaticResource ScrollBarPageButtonStyle}" />
- </Track.IncreaseRepeatButton>
- </Track>
- </Grid>
- </ControlTemplate>
- <!--
- Define The ScrollBar Style
- -->
- <Style TargetType="{x:Type ScrollBar}">
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="OverridesDefaultStyle" Value="true" />
- <Style.Triggers>
- <Trigger Property="Orientation" Value="Vertical">
- <Setter Property="Width" Value="18" />
- <Setter Property="Height" Value="Auto" />
- <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
- </Trigger>
- <Trigger Property="Orientation" Value="Horizontal">
- <Setter Property="Width" Value="Auto" />
- <Setter Property="Height" Value="18" />
- <Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <!--
- This style does NOT break RichTextBox Scrolling
- -->
- <Style TargetType="{x:Type ScrollViewer}">
- <Style.Resources>
- <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
- </Style.Resources>
- </Style>
- <!--
- The Style below breaks Rich Text Box
- -->
- <!--<Style TargetType="{x:Type ScrollViewer}">
- <Setter Property="CanContentScroll" Value="True"></Setter>
- <Setter Property="PanningMode" Value="Both"></Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ScrollViewer}">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <ScrollContentPresenter Grid.Column="0" />
- <ScrollBar
- x:Name="PART_VerticalScrollBar"
- Grid.Row="0"
- Grid.Column="1"
- Maximum="{TemplateBinding ScrollableHeight}"
- ViewportSize="{TemplateBinding ViewportHeight}"
- Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
- Value="{TemplateBinding VerticalOffset}" />
- <ScrollBar
- x:Name="PART_HorizontalScrollBar"
- Grid.Row="1"
- Grid.Column="0"
- Maximum="{TemplateBinding ScrollableWidth}"
- Orientation="Horizontal"
- ViewportSize="{TemplateBinding ViewportWidth}"
- Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
- Value="{TemplateBinding HorizontalOffset}" />
- --><!--<Rectangle Grid.Row="1" Grid.Column="1" Fill="Red"/>--><!--
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>-->
- </ResourceDictionary>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement