Free cookie consent management tool by TermsFeed Policy Generator

source: stable/HeuristicLab.ExtLibs/HeuristicLab.AvalonEdit/5.0.1/AvalonEdit-5.0.1/Search/DropDownButton.xaml @ 17693

Last change on this file since 17693 was 11700, checked in by jkarder, 10 years ago

#2077: created branch and added first version

File size: 4.1 KB
Line 
1<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3  xmlns:local="clr-namespace:ICSharpCode.AvalonEdit.Search"
4>
5  <!-- Colors for DropDownButton and SplitButton -->
6  <SolidColorBrush x:Key="{ComponentResourceKey {x:Type local:DropDownButton}, ActiveBorder}" Color="#FF0A246A"/>
7  <SolidColorBrush x:Key="{ComponentResourceKey {x:Type local:DropDownButton}, ActiveBackground}" Color="#FFB6BDD2"/>
8 
9  <!-- Style and Template for DropDownButton -->
10  <Style TargetType="{x:Type local:DropDownButton}">
11    <Setter Property="TextElement.Foreground" Value = "{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
12    <Setter Property="Control.Padding" Value="2,2,2,2"/>
13    <Setter Property="Border.BorderThickness" Value="1,1,1,1"/>
14    <Setter Property="Panel.Background" Value="Transparent"/>
15    <Setter Property="Border.BorderBrush" Value="Transparent"/>
16    <Setter Property="FrameworkElement.HorizontalAlignment" Value="Center"/>
17    <Setter Property="FrameworkElement.VerticalAlignment" Value="Center"/>
18    <Setter Property="Control.HorizontalContentAlignment" Value="Center"/>
19    <Setter Property="Control.VerticalContentAlignment" Value="Center"/>
20    <Setter Property="Template">
21      <Setter.Value>
22        <ControlTemplate TargetType="local:DropDownButton"
23                         xmlns:s="clr-namespace:System;assembly=mscorlib">
24          <Border
25            BorderThickness="{TemplateBinding Border.BorderThickness}"
26            BorderBrush="{TemplateBinding Border.BorderBrush}"
27            Background="{TemplateBinding Panel.Background}"
28            Name="OuterBorder"
29            SnapsToDevicePixels="True"
30          >
31            <StackPanel Orientation="Horizontal">
32              <ContentPresenter
33                Margin="{TemplateBinding Control.Padding}"
34                Content="{TemplateBinding ContentControl.Content}"
35                ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
36                ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
37                HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
38                VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
39                SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
40              <Path Margin="0,2,2,2"
41                    Data = "M0,0 L1,0 0.5,1 z"
42                    Fill = "{TemplateBinding TextElement.Foreground}"
43                    Width = "7"
44                    Height = "3.5"
45                    Stretch = "Fill"/>
46            </StackPanel>
47          </Border>
48          <ControlTemplate.Triggers>
49            <Trigger Property="UIElement.IsMouseOver" Value="True">
50              <Setter Property="Border.BorderBrush" TargetName="OuterBorder" Value="{DynamicResource {ComponentResourceKey {x:Type local:DropDownButton}, ActiveBorder}}" />
51              <Setter Property="Panel.Background" TargetName="OuterBorder" Value="{DynamicResource {ComponentResourceKey {x:Type local:DropDownButton}, ActiveBackground}}"/>
52            </Trigger>
53            <Trigger Property="UIElement.IsKeyboardFocused" Value="True">
54              <Setter Property="Border.BorderBrush" TargetName="OuterBorder" Value="{DynamicResource {ComponentResourceKey {x:Type local:DropDownButton}, ActiveBorder}}"/>
55              <Setter Property="Panel.Background" TargetName="OuterBorder" Value="{DynamicResource {ComponentResourceKey {x:Type local:DropDownButton}, ActiveBackground}}"/>
56            </Trigger>
57            <Trigger Property="UIElement.IsEnabled" Value="False">
58              <Setter Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
59            </Trigger>
60            <Trigger Property="local:DropDownButton.IsDropDownContentOpen" Value="True">
61              <Setter Property="Border.BorderBrush" TargetName="OuterBorder" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
62              <Setter Property="Border.BorderThickness" TargetName="OuterBorder" Value="1,1,1,0" />
63              <Setter Property="Border.Padding" TargetName="OuterBorder" Value="0,0,0,1" />
64              <Setter Property="Panel.Background" TargetName="OuterBorder" Value="Transparent"/>
65            </Trigger>
66          </ControlTemplate.Triggers>
67        </ControlTemplate>
68      </Setter.Value>
69    </Setter>
70  </Style>
71</ResourceDictionary>
Note: See TracBrowser for help on using the repository browser.