mirror of
https://github.com/DarthAffe/RGBSyncPlus
synced 2025-12-13 09:28:31 +00:00
164 lines
9.0 KiB
XML
164 lines
9.0 KiB
XML
<styles:CachedResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:styles="clr-namespace:RGBSyncPlus.Styles"
|
|
xmlns:converter="clr-namespace:RGBSyncPlus.Converter">
|
|
|
|
<styles:CachedResourceDictionary.MergedDictionaries>
|
|
<styles:CachedResourceDictionary Source="/RGBSync+;component/Styles/FrameworkElement.xaml" />
|
|
<styles:CachedResourceDictionary Source="/RGBSync+;component/Styles/Theme.xaml" />
|
|
</styles:CachedResourceDictionary.MergedDictionaries>
|
|
|
|
<converter:ScrollOffsetToOpacityMaskConverter x:Key="ScrollOffsetToOpacityMaskConverter" />
|
|
<converter:ScrollOffsetToVisibilityConverter x:Key="ScrollOffsetToVisibilityConverter" />
|
|
|
|
<Style x:Key="ListBoxScrollViewButtonStyle" TargetType="RepeatButton">
|
|
<Style.Setters>
|
|
<Setter Property="Background" Value="{StaticResource BrushListBoxScrollButtonBackground}"></Setter>
|
|
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="RepeatButton">
|
|
<Border x:Name="ButtonBorder"
|
|
HorizontalAlignment="Center"
|
|
Width="80"
|
|
Height="30"
|
|
BorderThickness="1"
|
|
BorderBrush="{StaticResource BrushListBoxScrollButtonBorder}"
|
|
Background="{TemplateBinding Background}">
|
|
|
|
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" />
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style.Setters>
|
|
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Background" Value="{StaticResource BrushListBoxScrollButtonBackgroundHover}" />
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
<ControlTemplate x:Key="ListBoxTemplate" TargetType="ListBox">
|
|
<Grid>
|
|
<ScrollViewer x:Name="ScrollViewer" CanContentScroll="False" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden">
|
|
<ScrollViewer.OpacityMask>
|
|
<MultiBinding Converter="{StaticResource ScrollOffsetToOpacityMaskConverter}" ConverterParameter="30">
|
|
<Binding ElementName="ScrollViewer" Path="VerticalOffset" />
|
|
<Binding ElementName="ScrollViewer" Path="ScrollableHeight" />
|
|
<Binding ElementName="ScrollViewer" Path="ActualHeight" />
|
|
</MultiBinding>
|
|
</ScrollViewer.OpacityMask>
|
|
|
|
<ItemsPresenter />
|
|
</ScrollViewer>
|
|
|
|
<DockPanel LastChildFill="False">
|
|
<RepeatButton DockPanel.Dock="Top" Style="{StaticResource ListBoxScrollViewButtonStyle}"
|
|
Command="{x:Static ScrollBar.LineUpCommand}" CommandTarget="{Binding ElementName=ScrollViewer}">
|
|
<RepeatButton.Visibility>
|
|
<MultiBinding Converter="{StaticResource ScrollOffsetToVisibilityConverter}" ConverterParameter="Top">
|
|
<Binding ElementName="ScrollViewer" Path="VerticalOffset"/>
|
|
<Binding ElementName="ScrollViewer" Path="ScrollableHeight"/>
|
|
</MultiBinding>
|
|
</RepeatButton.Visibility>
|
|
<RepeatButton.Content>
|
|
<Image Source="/RGBSync+;component/Resources/arrow_up.png" Stretch="Uniform" />
|
|
</RepeatButton.Content>
|
|
</RepeatButton>
|
|
<RepeatButton DockPanel.Dock="Bottom" Style="{StaticResource ListBoxScrollViewButtonStyle}"
|
|
Command="{x:Static ScrollBar.LineDownCommand}" CommandTarget="{Binding ElementName=ScrollViewer}">
|
|
<RepeatButton.Visibility>
|
|
<MultiBinding Converter="{StaticResource ScrollOffsetToVisibilityConverter}" ConverterParameter="Bottom">
|
|
<Binding ElementName="ScrollViewer" Path="VerticalOffset"/>
|
|
<Binding ElementName="ScrollViewer" Path="ScrollableHeight"/>
|
|
</MultiBinding>
|
|
</RepeatButton.Visibility>
|
|
<RepeatButton.Content>
|
|
<Image Source="/RGBSync+;component/Resources/arrow_down.png" Stretch="Uniform" />
|
|
</RepeatButton.Content>
|
|
</RepeatButton>
|
|
</DockPanel>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
|
|
<Style x:Key="StyleListBoxItemContainer"
|
|
TargetType="{x:Type ListBoxItem}">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="ListBoxItem">
|
|
<Border x:Name="ItemBorder"
|
|
HorizontalAlignment="Stretch"
|
|
BorderThickness="0"
|
|
BorderBrush="Transparent"
|
|
Background="{StaticResource BrushListBoxItemBackground}">
|
|
<ContentPresenter />
|
|
</Border>
|
|
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Trigger.EnterActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<ColorAnimation Storyboard.TargetName="ItemBorder"
|
|
Storyboard.TargetProperty="Background.Color"
|
|
To="{StaticResource ColorListBoxItemBackgroundHover}"
|
|
Duration="0:0:0.2" />
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.EnterActions>
|
|
<Trigger.ExitActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<ColorAnimation Storyboard.TargetName="ItemBorder"
|
|
Storyboard.TargetProperty="Background.Color"
|
|
Duration="0:0:0.25" />
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.ExitActions>
|
|
</Trigger>
|
|
<Trigger Property="IsSelected" Value="True">
|
|
<Trigger.EnterActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<ColorAnimation Storyboard.TargetName="ItemBorder"
|
|
Storyboard.TargetProperty="Background.Color"
|
|
To="{StaticResource ColorListBoxItemBackgroundSelected}"
|
|
Duration="0:0:0.2" />
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.EnterActions>
|
|
<Trigger.ExitActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<ColorAnimation Storyboard.TargetName="ItemBorder"
|
|
Storyboard.TargetProperty="Background.Color"
|
|
Duration="0:0:0.25" />
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.ExitActions>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="StyleListBox"
|
|
BasedOn="{StaticResource StyleFrameworkElement}"
|
|
TargetType="ListBox">
|
|
<Setter Property="Foreground" Value="{StaticResource BrushButtonForeground}" />
|
|
<Setter Property="FontSize" Value="{StaticResource FontSizeDefault}" />
|
|
<Setter Property="FontFamily" Value="pack://application:,,,/Resources/#Cinzel" />
|
|
<Setter Property="Background" Value="{StaticResource BrushButtonBackground}" />
|
|
<Setter Property="BorderBrush" Value="{StaticResource BrushButtonBorder}" />
|
|
<Setter Property="BorderThickness" Value="2" />
|
|
<Setter Property="Padding" Value="4,2" />
|
|
|
|
<Setter Property="ItemContainerStyle" Value="{StaticResource StyleListBoxItemContainer}" />
|
|
<Setter Property="Template" Value="{StaticResource ListBoxTemplate}" />
|
|
</Style>
|
|
|
|
</styles:CachedResourceDictionary>
|
|
|