Files
Artemis/Artemis/ColorBox/Themes/Generic.xaml
T
SpoinkyNL ef27b23116 Added ColorBox source
Added direction buttons functionality
2016-10-07 00:01:31 +02:00

759 lines
52 KiB
XML

<!--***************** NCore Softwares Pvt. Ltd., India **************************
ColorBox
Copyright (C) 2013 NCore Softwares Pvt. Ltd.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://colorbox.codeplex.com/license
*********************************************************************************** -->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ColorBox">
<Geometry x:Key="SkewIcon">M456.021,227.816L545.590,227.816L456.021,362.171L366.452,362.171L456.021,227.816</Geometry>
<Geometry x:Key="TranslateIcon">M384,289.828L384,363L457.171,363M384,363L457.171,289.828M480,267L480,310.011L435.711,267L480,267</Geometry>
<Geometry x:Key="RotateIcon">F1 M 32.0034,13.0019L 35.0033,16.002L 35.0034,24.0019L 27.0033,24.002L 24.0034,21.0019L 29.5944,21.0014C 28.2209,19.4668 26.2249,18.501 24.0033,18.501C 19.8606,18.501 16.5022,21.8593 16.5022,26.002C 16.5022,28.0734 17.3418,29.9486 18.6992,31.3061L 16.2241,33.7812C 14.2332,31.7903 13.0018,29.0399 13.0018,26.0019C 13.0018,19.926 17.9274,15.0004 24.0033,15.0004C 27.1557,15.0004 29.9984,16.3263 32.0042,18.4508L 32.0034,13.0019 Z</Geometry>
<Geometry x:Key="ScaleIcon">F1 M 28,13L 36,13L 36,21L 33,24L 33,18.5L 24,27.5L 21.5,25L 30.5,16L 25,16L 28,13 Z M 13,18L 26,18L 23,21L 16,21L 16,33L 28,33L 28,26L 31,23L 31,36L 13,36L 13,18 Z</Geometry>
<Geometry x:Key="CenterIcon">M502.672,272.601C502.672,298.366 481.785,319.252 456.021,319.252 430.257,319.252 409.370,298.366 409.370,272.601 409.370,246.837 430.257,225.950 456.021,225.950 481.785,225.950 502.672,246.837 502.672,272.601zM502.672,272.601C502.672,298.366 481.785,319.252 456.021,319.252 430.257,319.252 409.370,298.366 409.370,272.601 409.370,246.837 430.257,225.950 456.021,225.950 481.785,225.950 502.672,246.837 502.672,272.601zM470.531,272.601C470.531,280.615 464.035,287.111 456.021,287.111 448.007,287.111 441.511,280.615 441.511,272.601 441.511,264.588 448.007,258.091 456.021,258.091 464.035,258.091 470.531,264.588 470.531,272.601z</Geometry>
<Geometry x:Key="FlipIcon">M384,267L384,363L480,363M384,363L459.026,286.973L438,267L479.000,267L479.000,307.000L459.026,286.973</Geometry>
<BooleanToVisibilityConverter x:Key="BoolToVis" />
<VisualBrush x:Key="AlphaBrush" Stretch="None" TileMode="Tile" ViewportUnits="Absolute" Viewport="0,0,8,8">
<VisualBrush.Visual>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4" />
<ColumnDefinition Width="4" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="4" />
<RowDefinition Height="4" />
</Grid.RowDefinitions>
<Rectangle Fill="#FFF" Grid.Row="0" Grid.Column="0" />
<Rectangle Fill="#AAA" Grid.Row="0" Grid.Column="1" />
<Rectangle Fill="#AAA" Grid.Row="1" Grid.Column="0" />
<Rectangle Fill="#FFF" Grid.Row="1" Grid.Column="1" />
</Grid>
</VisualBrush.Visual>
</VisualBrush>
<Style TargetType="Path" x:Key="IconStyle">
<Setter Property="Height" Value="16" />
<Setter Property="Width" Value="16" />
<Setter Property="Fill" Value="#000000" />
<Setter Property="Stretch" Value="Fill" />
</Style>
<Style TargetType="Slider" x:Key="OpacitySliderStyle">
<Setter Property="Value"
Value="{Binding Brush.Opacity, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" />
<Setter Property="IsMoveToPointEnabled" Value="True" />
<Setter Property="Margin" Value="2" />
<Setter Property="Minimum" Value="0" />
<Setter Property="Maximum" Value="1" />
</Style>
<!-- Gradient Stop Thumb Style -->
<Style x:Key="SliderThumbStyle" TargetType="Thumb">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="BorderBrush" Value="#000000" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Thumb">
<Grid>
<Path Data="M468.9,240 A71.7,71.7,0,1,0,593, 240 M468.9,240 L531,152 L593,240"
Height="16" Width="14" Stretch="Fill"
Fill="#FFFFFF" Stroke="{TemplateBinding BorderBrush}" />
<Path Data="M468.9,240 A71.7,71.7,0,1,0,593,240 M468.9,240 L531,152 L593,240"
Height="12" Width="8" Stretch="Fill"
Fill="{TemplateBinding Background}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Gradient Stop Slider Style -->
<Style x:Key="GradientStopSliderStyle" TargetType="Slider">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Slider">
<Track x:Name="PART_Track">
<Track.Thumb>
<Thumb Style="{StaticResource SliderThumbStyle}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}" />
</Track.Thumb>
</Track>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ******* DoubleUpDown ******* -->
<Style x:Key="NumericUpDown" TargetType="{x:Type local:UpDownBase}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Foreground" Value="#000000" />
<Setter Property="Background" Value="#FFFFFF" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Margin" Value="2" />
<Setter Property="Padding" Value="5,1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:UpDownBase">
<local:Spinner IsTabStop="False"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}">
<TextBox x:Name="PART_TextBox"
FocusVisualStyle="{x:Null}"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
ContextMenu="{TemplateBinding ContextMenu}"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontStretch="{TemplateBinding FontStretch}"
FontStyle="{TemplateBinding FontStyle}"
FontWeight="{TemplateBinding FontWeight}"
Foreground="{TemplateBinding Foreground}"
IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"
TabIndex="{TemplateBinding TabIndex}"
local:TextBoxBehavior.SelectAllTextOnFocus="True" />
</local:Spinner>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type local:DoubleUpDown}" BasedOn="{StaticResource NumericUpDown}">
<Setter Property="Increment" Value=".1" />
<Setter Property="FormatString" Value="F1" />
</Style>
<!-- ******* Spinner ******* -->
<Style TargetType="{x:Type local:Spinner}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Background" Value="#FFFFFF" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Focusable" Value="False" />
<Setter Property="IsTabStop" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:Spinner}">
<Border Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}">
<ContentPresenter />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ******* ColorBox ******* -->
<Style TargetType="{x:Type local:ColorBox}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Background" Value="#E7E8E8" />
<Setter Property="BorderBrush" Value="#000000" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:ColorBox}">
<Border x:Name="PART_Root"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Border.InputBindings>
<KeyBinding Key="Delete" Command="{x:Static local:ColorBox.RemoveGradientStop}" />
</Border.InputBindings>
<StackPanel Margin="5">
<StackPanel.Resources>
<Style x:Key="TbStyle" TargetType="TextBlock">
<Setter Property="Margin" Value="2" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
</StackPanel.Resources>
<ListBox x:Name="listAvailableBrushType"
HorizontalContentAlignment="Center"
SelectedItem="{Binding BrushType, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
ItemsSource="{Binding AvailableBrushTypes, RelativeSource={RelativeSource TemplatedParent}}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Rows="1" Columns="4" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border x:Name="Border" Background="Transparent" Padding="0,3">
<Path x:Name="Icon" Height="12" Width="20" Stretch="Fill"
Fill="#FF403C3C" StrokeThickness="1" Stroke="#000000"
Data="M371,190L557,190 557,293 371,293 371,190z" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Gray"
TargetName="Border" />
<Setter Property="Foreground" Value="#FFFFFF" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="Gray"
TargetName="Border" />
<Setter Property="Foreground" Value="#FFFFFF" />
</Trigger>
<DataTrigger Binding="{Binding}" Value="None">
<Setter Property="ToolTip" Value="No Brush" />
<Setter Property="StrokeThickness" TargetName="Icon"
Value="0" />
<Setter TargetName="Icon" Property="Data">
<Setter.Value>
<Geometry>M612,189L452.949,189L452.949,266.024L612,189 M612,196.999L452.949,273.999L612,273.999L612,196.999</Geometry>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding}" Value="Solid">
<Setter Property="ToolTip" Value="Solid Color Brush" />
<Setter Property="Fill" TargetName="Icon" Value="#FF403C3C" />
</DataTrigger>
<DataTrigger Binding="{Binding}" Value="Linear">
<Setter Property="ToolTip" Value="Linear Gradient Brush" />
<Setter Property="Fill" TargetName="Icon">
<Setter.Value>
<LinearGradientBrush StartPoint="0,.5"
EndPoint="1,.5">
<GradientStop Color="#FF403C3C" Offset="0" />
<GradientStop Color="#FFFFFF" Offset="1" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding}" Value="Radial">
<Setter Property="ToolTip" Value="Radial Gradient Brush" />
<Setter Property="Fill" TargetName="Icon">
<Setter.Value>
<RadialGradientBrush>
<GradientStop Color="#FF403C3C" Offset="1" />
<GradientStop Color="#FFFFFF" />
</RadialGradientBrush>
</Setter.Value>
</Setter>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
<ScrollViewer Margin="0,5,0,5" HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Disabled">
<ScrollViewer.Style>
<Style TargetType="ScrollViewer">
<Style.Triggers>
<DataTrigger
Binding="{Binding ElementName=listAvailableBrushType, Path=SelectedValue}"
Value="None">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</ScrollViewer.Style>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="20" />
</Grid.ColumnDefinitions>
<!-- saturation / brightness selector -->
<Grid Grid.Column="0" ClipToBounds="true">
<local:SaturationBrightnessSelector x:Name="SV" MinHeight="128"
Saturation="{Binding Path=Saturation,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
Brightness="{Binding Path=Brightness,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
Hue="{Binding ElementName=H,Path=Hue}" />
<Grid VerticalAlignment="Top" HorizontalAlignment="Left" Margin="-6,-6,0,0"
Width="12" Height="12">
<Ellipse Stroke="#000000" />
<Ellipse Stroke="#FFFFFF" Margin="1" />
<Grid.RenderTransform>
<TranslateTransform X="{Binding ElementName=SV,Path=SaturationOffset}"
Y="{Binding ElementName=SV,Path=BrightnessOffset}" />
</Grid.RenderTransform>
</Grid>
</Grid>
<!-- hue selector -->
<local:HueSelector x:Name="H" Grid.Column="2"
Hue="{Binding Path=Hue,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" />
<Path Grid.Column="2" HorizontalAlignment="Left" Margin="0,-5,0,5" Stroke="#FFFFFF"
Fill="#000000" Data="M 0 0 L 7 5 L 0 10Z">
<Path.RenderTransform>
<TranslateTransform Y="{Binding ElementName=H,Path=HueOffset}" />
</Path.RenderTransform>
</Path>
<Path Grid.Column="2" HorizontalAlignment="Right" Margin="0,-5,0,5"
Stroke="#FFFFFF" Fill="#000000" Data="M 0 5 L 7 0 L 7 10 Z">
<Path.RenderTransform>
<TranslateTransform Y="{Binding ElementName=H,Path=HueOffset}" />
</Path.RenderTransform>
</Path>
<!-- alpha selector -->
<Rectangle Grid.Column="4" Fill="{StaticResource AlphaBrush}" />
<local:AlphaSelector x:Name="A" Grid.Column="4"
Alpha="{Binding Path=Alpha,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" />
<Path Grid.Column="4" HorizontalAlignment="Left" Margin="0,-5,0,5" Stroke="#FFFFFF"
Fill="#000000" Data="M 0 0 L 7 5 L 0 10Z">
<Path.RenderTransform>
<TranslateTransform Y="{Binding ElementName=A,Path=AlphaOffset}" />
</Path.RenderTransform>
</Path>
<Path Grid.Column="4" HorizontalAlignment="Right" Margin="0,-5,0,5"
Stroke="#FFFFFF" Fill="#000000" Data="M 0 5 L 7 0 L 7 10 Z">
<Path.RenderTransform>
<TranslateTransform Y="{Binding ElementName=A,Path=AlphaOffset}" />
</Path.RenderTransform>
</Path>
</Grid>
</ScrollViewer>
<Grid Height="20">
<!-- Hide when brush type is None -->
<Grid.Style>
<Style TargetType="Grid">
<Style.Triggers>
<DataTrigger
Binding="{Binding ElementName=listAvailableBrushType, Path=SelectedValue}"
Value="None">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Rectangle>
<Rectangle.Fill>
<SolidColorBrush
Color="{Binding Color, RelativeSource={RelativeSource TemplatedParent}}" />
</Rectangle.Fill>
</Rectangle>
<TextBox x:Name="PART_CurrentColor"
Text="{Binding Color, RelativeSource={RelativeSource TemplatedParent}}"
local:TextBoxBehavior.SelectAllTextOnFocus="True"
Grid.Column="2" MinWidth="100">
<TextBox.Style>
<Style TargetType="TextBox">
<Setter Property="BorderBrush"
Value="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1" Padding="0">
<ScrollViewer x:Name="PART_ContentHost" Margin="0" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</TextBox.Style>
</TextBox>
</Grid>
<Grid Margin="0,5,0,0" Focusable="False">
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger
Binding="{Binding ElementName=listAvailableBrushType, Path=SelectedValue}"
Value="Linear">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger
Binding="{Binding ElementName=listAvailableBrushType, Path=SelectedValue}"
Value="Radial">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="Auto" MinWidth="45" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Focusable="False">
<!-- Click to add gradient stop -->
<local:GradientStopAdder Height="20" Margin="7,0"
Focusable="False"
IsTabStop="False"
FocusVisualStyle="{x:Null}"
ColorBox="{Binding RelativeSource={RelativeSource TemplatedParent}}">
<local:GradientStopAdder.Background>
<LinearGradientBrush
GradientStops="{Binding Brush.GradientStops, RelativeSource={RelativeSource TemplatedParent}}"
StartPoint="0,.5" EndPoint="1,.5" />
</local:GradientStopAdder.Background>
<Button.Style>
<Style TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border BorderThickness="0"
Background="{TemplateBinding Background}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Button.Style>
</local:GradientStopAdder>
<!-- gradient stops -->
<ListBox x:Name="lbGradientStops"
ItemsSource="{Binding Path=Gradients, RelativeSource={RelativeSource TemplatedParent}}"
SelectedItem="{Binding SelectedGradient,RelativeSource={RelativeSource TemplatedParent}}"
Background="{x:Null}" Style="{x:Null}" BorderThickness="0"
FocusVisualStyle="{x:Null}" Focusable="False" IsTabStop="False">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<local:GradientStopSlider x:Name="PART_Slider"
BorderBrush="#000000"
IsTabStop="False"
Style="{StaticResource GradientStopSliderStyle}"
Value="{Binding Offset}"
Minimum="0" Maximum="1"
ColorBox="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ColorBox}}}"
SelectedGradient="{Binding}"
Margin="0,0,0,2">
<local:GradientStopSlider.Background>
<SolidColorBrush Color="{Binding Color}" />
</local:GradientStopSlider.Background>
</local:GradientStopSlider>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush"
TargetName="PART_Slider" Value="Orange" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="BorderBrush"
TargetName="PART_Slider" Value="Blue" />
<Setter Property="Effect" TargetName="PART_Slider">
<Setter.Value>
<DropShadowEffect ShadowDepth="2"
BlurRadius="2"
Direction="270" />
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<Grid IsItemsHost="True" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</StackPanel>
<Button Grid.Column="2"
Command="{x:Static local:ColorBox.ReverseGradientStop}"
Background="Transparent"
BorderBrush="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="Reverse gradient stops">
<Button.Style>
<Style TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Name="Border"
BorderThickness="1"
BorderBrush="{TemplateBinding BorderBrush}"
Background="{TemplateBinding Background}">
<Path x:Name="Icon"
Data="F1 M 10.0001,27L 10,16L 29.25,16L 25,12L 31.5,12L 38,18L 31.5,24L 25,24L 29.25,20L 14,20L 14,23.5L 10.0001,27 Z M 38,21L 38,32L 18.75,32L 23,36L 16.5,36L 10,30L 16.5,24L 23,24L 18.75,28L 34,28L 34,24.5L 38,21 Z"
StrokeThickness="0" Fill="#000000" Height="16"
Width="20" Stretch="Fill" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Icon" Property="Fill">
<Setter.Value>
<SolidColorBrush
Color="{Binding Color, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ColorBox}}}" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="BorderBrush" TargetName="Border">
<Setter.Value>
<SolidColorBrush
Color="{Binding Color, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ColorBox}}}" />
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Button.Style>
</Button>
</Grid>
<StackPanel Margin="0,5,0,0">
<StackPanel.Style>
<Style TargetType="StackPanel">
<Style.Triggers>
<DataTrigger
Binding="{Binding ElementName=listAvailableBrushType, Path=SelectedValue}"
Value="None">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Style>
<ToggleButton x:Name="PART_AdditionalPropertyOpen"
BorderBrush="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="Additional Properties"
Height="20">
<ToggleButton.Style>
<Style TargetType="ToggleButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Border x:Name="Border"
BorderThickness="1"
Background="Transparent"
BorderBrush="{TemplateBinding BorderBrush}">
<Path x:Name="Icon"
Data="M518.000,395.000C509.500,377.166,484.333,306.833,467.000,288C449.666,269.166,405.500,262.000,414,282C422.499,301.999,484.166,408,518.000,408C551.833,408,609,301.999,617.000,282C625.000,262.000,582.500,269.166,566.000,288C549.500,306.833,526.000,377.166,518.000,395.000"
Height="12" Width="18"
Fill="{TemplateBinding Foreground}"
Stretch="Fill"
VerticalAlignment="Center"
HorizontalAlignment="Center"
RenderTransformOrigin=".5,.5" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Icon" Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleY="-1" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Icon" Property="Fill">
<Setter.Value>
<SolidColorBrush
Color="{Binding Color, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ColorBox}}}" />
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ToggleButton.Style>
</ToggleButton>
<StackPanel Margin="0,5,0,0"
Visibility="{Binding ElementName=PART_AdditionalPropertyOpen, Path=IsChecked, Converter={StaticResource BoolToVis}}">
<!-- Solid brush -->
<DockPanel Margin="0,2">
<DockPanel.Style>
<Style TargetType="DockPanel">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger
Binding="{Binding ElementName=listAvailableBrushType, Path=SelectedValue}"
Value="Solid">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</DockPanel.Style>
<TextBlock Text="Opacity" VerticalAlignment="Center" />
<Slider Style="{StaticResource OpacitySliderStyle}" Margin="10,0,0,0" />
</DockPanel>
<!-- Linear brush -->
<DockPanel>
<DockPanel.Style>
<Style TargetType="DockPanel">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger
Binding="{Binding ElementName=listAvailableBrushType, Path=SelectedValue}"
Value="Linear">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</DockPanel.Style>
<UniformGrid Rows="5" DockPanel.Dock="Left" Margin="0,0,5,0">
<TextBlock Text="Start Point" VerticalAlignment="Center" />
<TextBlock Text="End Point" VerticalAlignment="Center" />
<TextBlock Text="Mapping Mode" VerticalAlignment="Center" />
<TextBlock Text="Spread Method" VerticalAlignment="Center" />
<TextBlock Text="Opacity" VerticalAlignment="Center" />
</UniformGrid>
<UniformGrid Rows="5" DockPanel.Dock="Right">
<UniformGrid Rows="1">
<local:DoubleUpDown
Value="{Binding StartX, RelativeSource={RelativeSource TemplatedParent}}" />
<local:DoubleUpDown
Value="{Binding StartY, RelativeSource={RelativeSource TemplatedParent}}" />
</UniformGrid>
<UniformGrid Rows="1">
<local:DoubleUpDown
Value="{Binding EndX, RelativeSource={RelativeSource TemplatedParent}}" />
<local:DoubleUpDown
Value="{Binding EndY, RelativeSource={RelativeSource TemplatedParent}}" />
</UniformGrid>
<ComboBox Margin="2"
ItemsSource="{Binding MappingModeTypes, RelativeSource={RelativeSource TemplatedParent}}"
SelectedItem="{Binding MappingMode, RelativeSource={RelativeSource TemplatedParent}}" />
<ComboBox Margin="2"
ItemsSource="{Binding SpreadMethodTypes, RelativeSource={RelativeSource TemplatedParent}}"
SelectedItem="{Binding SpreadMethod, RelativeSource={RelativeSource TemplatedParent}}" />
<Slider Style="{StaticResource OpacitySliderStyle}" />
</UniformGrid>
</DockPanel>
<!-- Radial brush -->
<DockPanel>
<DockPanel.Style>
<Style TargetType="DockPanel">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger
Binding="{Binding ElementName=listAvailableBrushType, Path=SelectedValue}"
Value="Radial">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</DockPanel.Style>
<UniformGrid Rows="7" DockPanel.Dock="Left" Margin="0,0,5,0">
<TextBlock Text="Gradient Origin" VerticalAlignment="Center" />
<TextBlock Text="Center" VerticalAlignment="Center" />
<TextBlock Text="Radius X" VerticalAlignment="Center" />
<TextBlock Text="Radius Y" VerticalAlignment="Center" />
<TextBlock Text="Mapping Mode" VerticalAlignment="Center" />
<TextBlock Text="Spread Method" VerticalAlignment="Center" />
<TextBlock Text="Opacity" VerticalAlignment="Center" />
</UniformGrid>
<UniformGrid Rows="7" DockPanel.Dock="Right">
<UniformGrid Rows="1">
<local:DoubleUpDown
Value="{Binding GradientOriginX, RelativeSource={RelativeSource TemplatedParent}}" />
<local:DoubleUpDown
Value="{Binding GradientOriginY, RelativeSource={RelativeSource TemplatedParent}}" />
</UniformGrid>
<UniformGrid Rows="1">
<local:DoubleUpDown
Value="{Binding CenterX, RelativeSource={RelativeSource TemplatedParent}}" />
<local:DoubleUpDown
Value="{Binding CenterY, RelativeSource={RelativeSource TemplatedParent}}" />
</UniformGrid>
<local:DoubleUpDown
Value="{Binding RadiusX, RelativeSource={RelativeSource TemplatedParent}}" />
<local:DoubleUpDown
Value="{Binding RadiusY, RelativeSource={RelativeSource TemplatedParent}}" />
<ComboBox Margin="2"
ItemsSource="{Binding MappingModeTypes, RelativeSource={RelativeSource TemplatedParent}}"
SelectedItem="{Binding MappingMode, RelativeSource={RelativeSource TemplatedParent}}" />
<ComboBox Margin="2"
ItemsSource="{Binding SpreadMethodTypes, RelativeSource={RelativeSource TemplatedParent}}"
SelectedItem="{Binding SpreadMethod, RelativeSource={RelativeSource TemplatedParent}}" />
<Slider Style="{StaticResource OpacitySliderStyle}" />
</UniformGrid>
</DockPanel>
</StackPanel>
</StackPanel>
</StackPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>