@ -2,6 +2,72 @@
@@ -2,6 +2,72 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ICSharpCode.Core.Presentation"
>
<SolidColorBrush x:Key="DropDownButtonActiveBorder" Color="#FF0A246A"/>
<SolidColorBrush x:Key="DropDownButtonActiveBackground" Color="#FFB6BDD2"/>
<SolidColorBrush x:Key="SplitButtonPressedBackground" Color="#FF8592B5"/>
<Style TargetType="{x:Type local:DropDownButton}">
<Setter Property="TextElement.Foreground" Value = "{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
<Setter Property="Control.Padding" Value="2,2,2,2"/>
<Setter Property="Border.BorderThickness" Value="1,1,1,1"/>
<Setter Property="Panel.Background" Value="Transparent"/>
<Setter Property="Border.BorderBrush" Value="Transparent"/>
<Setter Property="FrameworkElement.HorizontalAlignment" Value="Center"/>
<Setter Property="FrameworkElement.VerticalAlignment" Value="Center"/>
<Setter Property="Control.HorizontalContentAlignment" Value="Center"/>
<Setter Property="Control.VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:DropDownButton"
xmlns:s="clr-namespace:System;assembly=mscorlib">
<Border
BorderThickness="{TemplateBinding Border.BorderThickness}"
BorderBrush="{TemplateBinding Border.BorderBrush}"
Background="{TemplateBinding Panel.Background}"
Name="OuterBorder"
SnapsToDevicePixels="True"
>
<StackPanel Orientation="Horizontal">
<ContentPresenter
Margin="{TemplateBinding Control.Padding}"
Content="{TemplateBinding ContentControl.Content}"
ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
<Path Margin="0,2,2,2"
Data = "M0,0 L1,0 0.5,1 z"
Fill = "{TemplateBinding TextElement.Foreground}"
Width = "7"
Height = "3.5"
Stretch = "Fill"/>
</StackPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="UIElement.IsMouseOver" Value="True">
<Setter Property="Border.BorderBrush" TargetName="OuterBorder" Value="{StaticResource DropDownButtonActiveBorder}" />
<Setter Property="Panel.Background" TargetName="OuterBorder" Value="{DynamicResource DropDownButtonActiveBackground}"/>
</Trigger>
<Trigger Property="UIElement.IsKeyboardFocused" Value="True">
<Setter Property="Border.BorderBrush" TargetName="OuterBorder" Value="{StaticResource DropDownButtonActiveBorder}"/>
<Setter Property="Panel.Background" TargetName="OuterBorder" Value="{StaticResource DropDownButtonActiveBackground}"/>
</Trigger>
<Trigger Property="UIElement.IsEnabled" Value="False">
<Setter Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
<Trigger Property="local:DropDownButton.IsDropDownMenuOpen" Value="True">
<Setter Property="Border.BorderBrush" TargetName="OuterBorder" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
<Setter Property="Border.BorderThickness" TargetName="OuterBorder" Value="1,1,1,0" />
<Setter Property="Border.Padding" TargetName="OuterBorder" Value="0,0,0,1" />
<Setter Property="Panel.Background" TargetName="OuterBorder" Value="Transparent"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type local:SplitButton}">
<Setter Property="TextElement.Foreground" Value = "{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
<Setter Property="Control.Padding" Value="2,2,2,2"/>
@ -33,7 +99,7 @@
@@ -33,7 +99,7 @@
VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
<Border
Name="PART_DropDownButton "
Name="PART_DropDownArrow "
BorderThickness="1,0,0,0"
BorderBrush="{Binding ElementName=OuterBorder, Path=BorderBrush}"
SnapsToDevicePixels="True"
@ -49,29 +115,29 @@
@@ -49,29 +115,29 @@
</Border>
<ControlTemplate.Triggers>
<Trigger Property="UIElement.IsMouseOver" Value="True">
<Setter Property="Border.BorderBrush" TargetName="OuterBorder" Value="#FF0A246A " />
<Setter Property="Panel.Background" TargetName="OuterBorder" Value="#FFB6BDD2 "/>
<Setter Property="Panel.Background" TargetName="PART_DropDownButton" Value="#FFB6BDD2 "/>
<Setter Property="Border.BorderBrush" TargetName="OuterBorder" Value="{StaticResource DropDownButtonActiveBorder} " />
<Setter Property="Panel.Background" TargetName="OuterBorder" Value="{StaticResource DropDownButtonActiveBackground} "/>
<Setter Property="Panel.Background" TargetName="PART_DropDownArrow" Value="{StaticResource DropDownButtonActiveBackground} "/>
</Trigger>
<Trigger Property="UIElement.IsKeyboardFocused" Value="True">
<Setter Property="Border.BorderBrush" TargetName="OuterBorder" Value="#FF0A246A" />
<Setter Property="Panel.Background" TargetName="OuterBorder" Value="#FFB6BDD2 "/>
<Setter Property="Panel.Background" TargetName="PART_DropDownButton" Value="#FFB6BDD2 "/>
<Setter Property="Border.BorderBrush" TargetName="OuterBorder" Value="{StaticResource DropDownButtonActiveBorder}" />
<Setter Property="Panel.Background" TargetName="OuterBorder" Value="{StaticResource DropDownButtonActiveBackground} "/>
<Setter Property="Panel.Background" TargetName="PART_DropDownArrow" Value="{StaticResource DropDownButtonActiveBackground} "/>
</Trigger>
<Trigger Property="ButtonBase.IsPressed" Value="True">
<Setter Property="Border.BorderBrush" TargetName="OuterBorder" Value="#FF0A246A" />
<Setter Property="Panel.Background" TargetName="OuterBorder" Value="#FF8592B5 "/>
<Setter Property="Border.BorderBrush" TargetName="OuterBorder" Value="{StaticResource DropDownButtonActiveBorder}" />
<Setter Property="Panel.Background" TargetName="OuterBorder" Value="{StaticResource SplitButtonPressedBackground} "/>
</Trigger>
<Trigger Property="UIElement.IsEnabled" Value="False">
<Setter Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
<Trigger Property="local:SplitButton.IsDropDownMenuOpen" Value="True">
<Setter Property="Border.BorderBrush" TargetName="OuterBorder" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
<Setter Property="Border.BorderBrush" TargetName="PART_DropDownButton " Value="Transparent" />
<Setter Property="Border.BorderBrush" TargetName="PART_DropDownArrow " Value="Transparent" />
<Setter Property="Border.BorderThickness" TargetName="OuterBorder" Value="1,1,1,0" />
<Setter Property="Border.Padding" TargetName="OuterBorder" Value="0,0,0,1" />
<Setter Property="Panel.Background" TargetName="OuterBorder" Value="Transparent"/>
<Setter Property="Panel.Background" TargetName="PART_DropDownButton " Value="Transparent"/>
<Setter Property="Panel.Background" TargetName="PART_DropDownArrow " Value="Transparent"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>