Initial style for ScrollBars making use of custom colors

As of now: all colors as in v1 are supported except ColorSliderArrowsAndTrackHover
This commit is contained in:
Peter Kirmeier 2023-08-15 00:13:18 +02:00
parent 10d2e8dac6
commit 106d6bd090
4 changed files with 445 additions and 122 deletions

View file

@ -7,93 +7,100 @@
x:Class="SystemTrayMenu.App" ShutdownMode="OnExplicitShutdown">
<Application.Resources>
<BitmapImage x:Key="ApplicationImage" UriSource="../Resources/SystemTrayMenu.png" />
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/ScrollBarStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
<BitmapImage x:Key="ApplicationIconImage" UriSource="../Resources/SystemTrayMenu.ico" />
<BitmapImage x:Key="LinkArrowIconImage" UriSource="../Resources/LinkArrow.ico" />
<BitmapImage x:Key="LoadingIconImage" UriSource="../Resources/Loading.ico" />
<BitmapImage x:Key="NotFoundIconImage" UriSource="../Resources/NotFound.ico" />
<BitmapImage x:Key="ApplicationImage" UriSource="../Resources/SystemTrayMenu.png" />
<SolidColorBrush x:Key="ButtonHoverColor" Color="Gray" Opacity="0.5"/>
<BitmapImage x:Key="ApplicationIconImage" UriSource="../Resources/SystemTrayMenu.ico" />
<BitmapImage x:Key="LinkArrowIconImage" UriSource="../Resources/LinkArrow.ico" />
<BitmapImage x:Key="LoadingIconImage" UriSource="../Resources/Loading.ico" />
<BitmapImage x:Key="NotFoundIconImage" UriSource="../Resources/NotFound.ico" />
<Style TargetType="{x:Type Window}">
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
<Setter Property="Background" Value="{x:Static stm:MenuDefines.ColorBackground}" />
</Style>
<Style TargetType="{x:Type TabItem}">
<!-- not working for selected TabIdem yet, so we keep default colors -->
<!--Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" /-->
<!--Setter Property="Background" Value="{x:Static stm:MenuDefines.ColorBackground}" /-->
</Style>
<Style TargetType="{x:Type TabControl}">
<Setter Property="Background" Value="Transparent" />
</Style>
<Style TargetType="{x:Type TextBlock}">
<!--not used yet as several controls are using it but overwriting colors let them look bad -->
<!--Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" /-->
<!--Setter Property="Background" Value="{x:Static stm:MenuDefines.ColorBackground}" /-->
</Style>
<Style TargetType="{x:Type Label}">
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
</Style>
<Style TargetType="{x:Type GroupBox}">
<Setter Property="Margin" Value="2" />
<Setter Property="Padding" Value="2" />
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
</Style>
<Style TargetType="{x:Type TextBox}">
<!-- Please update HotkeySelector as well -->
<Setter Property="Height" Value="21" />
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
<Setter Property="Background" Value="{x:Static stm:MenuDefines.ColorBackground}" />
</Style>
<Style TargetType="{x:Type RichTextBox}">
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
<Setter Property="Background" Value="{x:Static stm:MenuDefines.ColorBackground}" />
</Style>
<Style TargetType="{x:Type CheckBox}">
<Setter Property="Margin" Value="3" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
</Style>
<Style TargetType="{x:Type ComboBox}">
<!-- not working for selected TabIdem yet, so we keep default colors -->
<!--Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" /-->
<!--Setter Property="Background" Value="{x:Static stm:MenuDefines.ColorBackground}" /-->
</Style>
<Style TargetType="{x:Type ListView}">
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
<Setter Property="Background" Value="{x:Static stm:MenuDefines.ColorBackground}" />
</Style>
<Style TargetType="{x:Type RadioButton}">
<Setter Property="Margin" Value="3" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
</Style>
<Style TargetType="{x:Type Button}">
<Setter Property="MinWidth" Value="76" />
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
<!-- TODO: Find better solution instead of re-implementing the control template of a button,
<SolidColorBrush x:Key="ButtonHoverColor" Color="Gray" Opacity="0.5"/>
<Style TargetType="{x:Type Window}">
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
<Setter Property="Background" Value="{x:Static stm:MenuDefines.ColorBackground}" />
</Style>
<Style TargetType="{x:Type TabItem}">
<!-- not working for selected TabIdem yet, so we keep default colors -->
<!--Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" /-->
<!--Setter Property="Background" Value="{x:Static stm:MenuDefines.ColorBackground}" /-->
</Style>
<Style TargetType="{x:Type TabControl}">
<Setter Property="Background" Value="Transparent" />
</Style>
<Style TargetType="{x:Type TextBlock}">
<!--not used yet as several controls are using it but overwriting colors let them look bad -->
<!--Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" /-->
<!--Setter Property="Background" Value="{x:Static stm:MenuDefines.ColorBackground}" /-->
</Style>
<Style TargetType="{x:Type Label}">
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
</Style>
<Style TargetType="{x:Type GroupBox}">
<Setter Property="Margin" Value="2" />
<Setter Property="Padding" Value="2" />
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
</Style>
<Style TargetType="{x:Type TextBox}">
<!-- Please update HotkeySelector as well -->
<Setter Property="Height" Value="21" />
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
<Setter Property="Background" Value="{x:Static stm:MenuDefines.ColorBackground}" />
</Style>
<Style TargetType="{x:Type RichTextBox}">
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
<Setter Property="Background" Value="{x:Static stm:MenuDefines.ColorBackground}" />
</Style>
<Style TargetType="{x:Type CheckBox}">
<Setter Property="Margin" Value="3" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
</Style>
<Style TargetType="{x:Type ComboBox}">
<!-- not working for selected TabIdem yet, so we keep default colors -->
<!--Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" /-->
<!--Setter Property="Background" Value="{x:Static stm:MenuDefines.ColorBackground}" /-->
</Style>
<Style TargetType="{x:Type ListView}">
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
<Setter Property="Background" Value="{x:Static stm:MenuDefines.ColorBackground}" />
</Style>
<Style TargetType="{x:Type RadioButton}">
<Setter Property="Margin" Value="3" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
</Style>
<Style TargetType="{x:Type Button}">
<Setter Property="MinWidth" Value="76" />
<Setter Property="Foreground" Value="{x:Static stm:MenuDefines.ColorForeground}" />
<!-- TODO: Find better solution instead of re-implementing the control template of a button,
only to manage changing the mouse hover border color. -->
<Setter Property="BorderBrush" Value="{StaticResource ButtonHoverColor}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="Border" Margin="2" Padding="7,5" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="{x:Static stm:MenuDefines.ColorSelectedItemBorder}" TargetName="Border" />
<Setter Property="Background" Value="{StaticResource ButtonHoverColor}" TargetName="Border" />
<Setter Property="Opacity" Value="0.9" TargetName="Border" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Setter Property="BorderBrush" Value="{StaticResource ButtonHoverColor}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="Border" Margin="2" Padding="7,5" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="{x:Static stm:MenuDefines.ColorSelectedItemBorder}" TargetName="Border" />
<Setter Property="Background" Value="{StaticResource ButtonHoverColor}" TargetName="Border" />
<Setter Property="Opacity" Value="0.9" TargetName="Border" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>

View file

@ -8,45 +8,7 @@ namespace SystemTrayMenu
internal static class AppColors
{
public static SolidColorBrush Arrow { get; internal set; } = new (Color.FromRgb(96, 96, 96));
public static SolidColorBrush ArrowHoverBackground { get; internal set; } = new (Color.FromRgb(218, 218, 218));
public static SolidColorBrush ArrowHover { get; internal set; } = new (Color.FromRgb(0, 0, 0));
public static SolidColorBrush ArrowClick { get; internal set; } = new (Color.FromRgb(255, 255, 255));
public static SolidColorBrush ArrowClickBackground { get; internal set; } = new (Color.FromRgb(96, 96, 96));
public static SolidColorBrush SliderArrowsAndTrackHover { get; internal set; } = new (Color.FromRgb(192, 192, 192));
public static SolidColorBrush Slider { get; internal set; } = new (Color.FromRgb(205, 205, 205));
public static SolidColorBrush SliderHover { get; internal set; } = new (Color.FromRgb(166, 166, 166));
public static SolidColorBrush SliderDragging { get; internal set; } = new (Color.FromRgb(96, 96, 96));
public static SolidColorBrush ScrollbarBackground { get; internal set; } = new (Color.FromRgb(240, 240, 240));
public static SolidColorBrush ArrowDarkMode { get; internal set; } = new (Color.FromRgb(103, 103, 103));
public static SolidColorBrush ArrowHoverBackgroundDarkMode { get; internal set; } = new (Color.FromRgb(55, 55, 55));
public static SolidColorBrush ArrowHoverDarkMode { get; internal set; } = new (Color.FromRgb(103, 103, 103));
public static SolidColorBrush ArrowClickDarkMode { get; internal set; } = new (Color.FromRgb(23, 23, 23));
public static SolidColorBrush ArrowClickBackgroundDarkMode { get; internal set; } = new (Color.FromRgb(166, 166, 166));
public static SolidColorBrush SliderArrowsAndTrackHoverDarkMode { get; internal set; } = new (Color.FromRgb(77, 77, 77));
public static SolidColorBrush SliderDarkMode { get; internal set; } = new (Color.FromRgb(77, 77, 77));
public static SolidColorBrush SliderHoverDarkMode { get; internal set; } = new (Color.FromRgb(122, 122, 122));
public static SolidColorBrush SliderDraggingDarkMode { get; internal set; } = new (Color.FromRgb(166, 166, 166));
public static SolidColorBrush ScrollbarBackgroundDarkMode { get; internal set; } = new (Color.FromRgb(23, 23, 23));
/* -- General -- */
public static SolidColorBrush SelectedItem { get; internal set; } = new(Color.FromRgb(204, 232, 255));
@ -79,5 +41,47 @@ namespace SystemTrayMenu
public static SolidColorBrush Icons { get; internal set; } = new (Color.FromRgb(149, 160, 166));
public static SolidColorBrush DarkModeIcons { get; internal set; } = new (Color.FromRgb(149, 160, 166));
/* -- ScrollBar -- */
public static SolidColorBrush Arrow { get; internal set; } = new(Color.FromRgb(96, 96, 96));
public static SolidColorBrush ArrowHoverBackground { get; internal set; } = new(Color.FromRgb(218, 218, 218));
public static SolidColorBrush ArrowHover { get; internal set; } = new(Color.FromRgb(0, 0, 0));
public static SolidColorBrush ArrowClick { get; internal set; } = new(Color.FromRgb(255, 255, 255));
public static SolidColorBrush ArrowClickBackground { get; internal set; } = new(Color.FromRgb(96, 96, 96));
public static SolidColorBrush SliderArrowsAndTrackHover { get; internal set; } = new(Color.FromRgb(192, 192, 192));
public static SolidColorBrush Slider { get; internal set; } = new(Color.FromRgb(205, 205, 205));
public static SolidColorBrush SliderHover { get; internal set; } = new(Color.FromRgb(166, 166, 166));
public static SolidColorBrush SliderDragging { get; internal set; } = new(Color.FromRgb(96, 96, 96));
public static SolidColorBrush ScrollbarBackground { get; internal set; } = new(Color.FromRgb(240, 240, 240));
public static SolidColorBrush ArrowDarkMode { get; internal set; } = new(Color.FromRgb(103, 103, 103));
public static SolidColorBrush ArrowHoverBackgroundDarkMode { get; internal set; } = new(Color.FromRgb(55, 55, 55));
public static SolidColorBrush ArrowHoverDarkMode { get; internal set; } = new(Color.FromRgb(103, 103, 103));
public static SolidColorBrush ArrowClickDarkMode { get; internal set; } = new(Color.FromRgb(23, 23, 23));
public static SolidColorBrush ArrowClickBackgroundDarkMode { get; internal set; } = new(Color.FromRgb(166, 166, 166));
public static SolidColorBrush SliderArrowsAndTrackHoverDarkMode { get; internal set; } = new(Color.FromRgb(77, 77, 77));
public static SolidColorBrush SliderDarkMode { get; internal set; } = new(Color.FromRgb(77, 77, 77));
public static SolidColorBrush SliderHoverDarkMode { get; internal set; } = new(Color.FromRgb(122, 122, 122));
public static SolidColorBrush SliderDraggingDarkMode { get; internal set; } = new(Color.FromRgb(166, 166, 166));
public static SolidColorBrush ScrollbarBackgroundDarkMode { get; internal set; } = new(Color.FromRgb(23, 23, 23));
}
}

View file

@ -11,6 +11,8 @@ namespace SystemTrayMenu
internal const int MenusMax = 50;
internal const int LengthMax = 37;
/* -- General -- */
public static SolidColorBrush ColorForeground =>
Config.IsDarkMode() ? Brushes.White : Brushes.Black;
@ -37,5 +39,37 @@ namespace SystemTrayMenu
public static SolidColorBrush ColorSearchField =>
Config.IsDarkMode() ? AppColors.DarkModeSearchField : AppColors.SearchField;
/* -- ScrollBar -- */
public static SolidColorBrush ColorArrow =>
Config.IsDarkMode() ? AppColors.ArrowDarkMode : AppColors.Arrow;
public static SolidColorBrush ColorArrowHoverBackground =>
Config.IsDarkMode() ? AppColors.ArrowHoverBackgroundDarkMode : AppColors.ArrowHoverBackground;
public static SolidColorBrush ColorArrowHover =>
Config.IsDarkMode() ? AppColors.ArrowHoverDarkMode : AppColors.ArrowHover;
public static SolidColorBrush ColorArrowClick =>
Config.IsDarkMode() ? AppColors.ArrowClickDarkMode : AppColors.ArrowClick;
public static SolidColorBrush ColorArrowClickBackground =>
Config.IsDarkMode() ? AppColors.ArrowClickBackgroundDarkMode : AppColors.ArrowClickBackground;
public static SolidColorBrush ColorSliderArrowsAndTrackHover =>
Config.IsDarkMode() ? AppColors.SliderArrowsAndTrackHoverDarkMode : AppColors.SliderArrowsAndTrackHover;
public static SolidColorBrush ColorSlider =>
Config.IsDarkMode() ? AppColors.SliderDarkMode : AppColors.Slider;
public static SolidColorBrush ColorSliderHover =>
Config.IsDarkMode() ? AppColors.SliderHoverDarkMode : AppColors.SliderHover;
public static SolidColorBrush ColorSliderDragging =>
Config.IsDarkMode() ? AppColors.SliderDraggingDarkMode : AppColors.SliderDragging;
public static SolidColorBrush ColorScrollbarBackground =>
Config.IsDarkMode() ? AppColors.ScrollbarBackgroundDarkMode : AppColors.ScrollbarBackground;
}
}

View file

@ -0,0 +1,278 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2023-2023 Peter Kirmeier -->
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:stm="clr-namespace:SystemTrayMenu">
<!-- Control Template Referene Example: -->
<!-- https://learn.microsoft.com/en-us/dotnet/desktop/wpf/controls/scrollbar-styles-and-templates -->
<!-- TODO: Check and adjust horizontal scrollbars -->
<!-- TODO: Take care of disabled scrollbars -->
<!-- TODO: Implement ColorSliderArrowsAndTrackHover -->
<Color x:Key="DisabledForegroundColor">Transparent</Color>
<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 x:Name="Border" Margin="0" CornerRadius="0" BorderThickness="0">
<Border.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<LinearGradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="{TemplateBinding Background}" Offset="0.0"/>
<GradientStop Color="{TemplateBinding Background}" Offset="1.0" />
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Border.Background>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorArrowHoverBackground},Path=Color}" />
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorArrowHoverBackground},Path=Color}" />
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Arrow"
Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorArrowHover},Path=Color}" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorArrowClickBackground},Path=Color}" />
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorArrowClickBackground},Path=Color}" />
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Arrow"
Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorArrowClick},Path=Color}" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Arrow"
Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
<EasingColorKeyFrame KeyTime="0" Value="{StaticResource DisabledForegroundColor}" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Path x:Name="Arrow" HorizontalAlignment="Center" VerticalAlignment="Center"
Data="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" >
<Path.Fill>
<SolidColorBrush Color="{Binding Source={x:Static stm:MenuDefines.ColorArrow},Path=Color}"/>
</Path.Fill>
</Path>
</Border>
</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" />
</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="IsTabStop" Value="false" />
<Setter Property="Focusable" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border x:Name="Border" CornerRadius="0" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorSliderHover},Path=Color}" />
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorSliderHover},Path=Color}" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorSliderDragging},Path=Color}" />
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorSliderDragging},Path=Color}" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
<Grid Background="{x:Static stm:MenuDefines.ColorScrollbarBackground}">
<Grid.RowDefinitions>
<RowDefinition MaxHeight="15" /> <!-- TODO: Scaling.Scale(15) -->
<RowDefinition Height="0.00001*" />
<RowDefinition MaxHeight="15" /> <!-- TODO: Scaling.Scale(15) -->
</Grid.RowDefinitions>
<RepeatButton Grid.Row="0"
Style="{StaticResource ScrollBarLineButton}"
Height="15"
Command="ScrollBar.LineUpCommand"
Content="M 0 4 L 8 4 L 4 0 Z" /> <!-- TODO: Width = Scaling.Scale(15) -->
<Track x:Name="PART_Track" Grid.Row="1" IsDirectionReversed="true">
<Track.DecreaseRepeatButton>
<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageUpCommand" />
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource ScrollBarThumb}" Margin="0">
<Thumb.BorderBrush>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
<LinearGradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="{TemplateBinding Background}" Offset="0.0" />
<GradientStop Color="{TemplateBinding Background}" Offset="1.0" />
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Thumb.BorderBrush>
<Thumb.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
<LinearGradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="{Binding Source={x:Static stm:MenuDefines.ColorSlider},Path=Color}" Offset="0.0" />
<GradientStop Color="{Binding Source={x:Static stm:MenuDefines.ColorSlider},Path=Color}" Offset="1.0" />
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Thumb.Background>
</Thumb>
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageDownCommand" />
</Track.IncreaseRepeatButton>
</Track>
<RepeatButton Grid.Row="2"
Style="{StaticResource ScrollBarLineButton}"
Height="15"
Command="ScrollBar.LineDownCommand"
Content="M 0 0 L 4 4 L 8 0 Z" /> <!-- TODO: Width = Scaling.Scale(15) -->
</Grid>
</ControlTemplate>
<ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
<Grid Background="{x:Static stm:MenuDefines.ColorScrollbarBackground}">
<Grid.ColumnDefinitions>
<ColumnDefinition MaxWidth="15" /> <!-- TODO: Scaling.Scale(15) -->
<ColumnDefinition Width="0.00001*" />
<ColumnDefinition MaxWidth="15" /> <!-- TODO: Scaling.Scale(15) -->
</Grid.ColumnDefinitions>
<RepeatButton Grid.Column="0"
Style="{StaticResource ScrollBarLineButton}"
Width="15"
Command="ScrollBar.LineLeftCommand"
Content="M 4 0 L 4 8 L 0 4 Z" /> <!-- TODO: Width = Scaling.Scale(15) -->
<Track x:Name="PART_Track" Grid.Column="1" IsDirectionReversed="False">
<Track.DecreaseRepeatButton>
<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageLeftCommand" />
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource ScrollBarThumb}" Margin="0">
<Thumb.BorderBrush>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
<LinearGradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="{TemplateBinding Background}" Offset="0.0" />
<GradientStop Color="{TemplateBinding Background}" Offset="1.0" />
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Thumb.BorderBrush>
<Thumb.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<LinearGradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="{Binding Source={x:Static stm:MenuDefines.ColorSlider},Path=Color}" Offset="0.0" />
<GradientStop Color="{Binding Source={x:Static stm:MenuDefines.ColorSlider},Path=Color}" Offset="1.0" />
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Thumb.Background>
</Thumb>
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageRightCommand" />
</Track.IncreaseRepeatButton>
</Track>
<RepeatButton Grid.Column="2"
Style="{StaticResource ScrollBarLineButton}"
Width="15"
Command="ScrollBar.LineRightCommand"
Content="M 0 0 L 4 4 L 0 8 Z" /> <!-- TODO: Width = Scaling.Scale(15) -->
</Grid>
</ControlTemplate>
<Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
<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="15" /> <!-- TODO: Scaling.Scale(15) -->
<Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
</Trigger>
<Trigger Property="Orientation" Value="Vertical">
<Setter Property="Width" Value="15" /> <!-- TODO: Scaling.Scale(15) -->
<Setter Property="Height" Value="Auto" />
<Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>