Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2839_HiveProjectManagement/HeuristicLab.ExtLibs/HeuristicLab.AvalonEdit/5.0.1/AvalonEdit-5.0.1/CodeCompletion/InsightWindow.xaml

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

#2077: created branch and added first version

File size: 5.8 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:cc="clr-namespace:ICSharpCode.AvalonEdit.CodeCompletion"
4>
5  <cc:InsightWindowTemplateSelector x:Key="templateSelector" />
6 
7  <!-- Template for InsightWindow. Based on the template for ToolTip. -->
8  <Style TargetType="{x:Type cc:InsightWindow}">
9    <Setter Property="SizeToContent" Value="WidthAndHeight" />
10   
11    <Setter Property="BorderThickness" Value="1" />
12    <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" />
13    <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.InfoBrushKey}}" />
14    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.InfoTextBrushKey}}" />
15    <Setter Property="FontFamily" Value="{DynamicResource {x:Static SystemFonts.StatusFontFamilyKey}}" />
16    <Setter Property="FontSize" Value="{DynamicResource {x:Static SystemFonts.StatusFontSizeKey}}" />
17    <Setter Property="FontStyle" Value="{DynamicResource {x:Static SystemFonts.StatusFontStyleKey}}" />
18    <Setter Property="FontWeight" Value="{DynamicResource {x:Static SystemFonts.StatusFontWeightKey}}" />
19    <Setter Property="Padding" Value="1,1,3,1" />
20    <Setter Property="HorizontalContentAlignment" Value="Left" />
21    <Setter Property="VerticalContentAlignment" Value="Center" />
22    <Setter Property="Template">
23      <Setter.Value>
24        <ControlTemplate TargetType="{x:Type cc:InsightWindow}">
25          <Border BorderThickness="{TemplateBinding Border.BorderThickness}"
26                  Padding="{TemplateBinding Control.Padding}"
27                  CornerRadius="2,2,2,2"
28                  BorderBrush="{TemplateBinding Border.BorderBrush}"
29                  Background="{TemplateBinding Panel.Background}">
30            <AdornerDecorator>
31              <ContentPresenter
32                Content="{TemplateBinding ContentControl.Content}"
33                ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
34                ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
35                HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
36                VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
37                SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
38            </AdornerDecorator>
39          </Border>
40        </ControlTemplate>
41      </Setter.Value>
42    </Setter>
43  </Style>
44 
45  <!-- Template for OverloadViewer. -->
46  <Style TargetType="{x:Type cc:OverloadViewer}">
47    <Setter Property="Template">
48      <Setter.Value>
49        <ControlTemplate TargetType="{x:Type cc:OverloadViewer}">
50          <Grid>
51            <Grid.Resources>
52              <cc:CollapseIfSingleOverloadConverter x:Key="collapseIfSingleOverloadConverter"/>
53             
54              <!-- Style of the UpDownButton -->
55              <Style TargetType="{x:Type Button}" x:Key="upDownButtonStyle">
56                <Style.Setters>
57                  <Setter Property="Background" Value="LightGray"/>
58                  <Setter Property="Padding" Value="2,2,2,2"/>
59                  <Setter Property="Width" Value="9"/>
60                  <Setter Property="Height" Value="9"/>
61                  <Setter Property="SnapsToDevicePixels" Value="True"/>
62                  <Setter Property="OverridesDefaultStyle" Value="True"/>
63                  <Setter Property="Template">
64                    <Setter.Value>
65                      <ControlTemplate TargetType="{x:Type Button}">
66                        <Border Name="bd"
67                                Background="{TemplateBinding Background}" CornerRadius="2">
68                          <ContentPresenter Margin="{TemplateBinding Padding}"
69                                            Content="{TemplateBinding Content}"/>
70                        </Border>
71                        <ControlTemplate.Triggers>
72                          <Trigger Property="IsMouseOver" Value="true">
73                            <Setter TargetName="bd" Property="Background" Value="LightBlue"/>
74                          </Trigger>
75                        </ControlTemplate.Triggers>
76                      </ControlTemplate>
77                    </Setter.Value>
78                  </Setter>
79                </Style.Setters>
80              </Style>
81           
82              <DataTemplate x:Key="TextBlockTemplate">
83                <TextBlock TextWrapping="Wrap" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content}" />
84              </DataTemplate>
85            </Grid.Resources>
86           
87            <Grid.ColumnDefinitions>
88              <ColumnDefinition Width="Auto"/>
89              <ColumnDefinition Width="1*"/>
90            </Grid.ColumnDefinitions>
91            <Grid.RowDefinitions>
92              <RowDefinition Height="Auto"/>
93              <RowDefinition Height="1*"/>
94            </Grid.RowDefinitions>
95           
96            <StackPanel Grid.Row="0" Grid.Column="0"
97                        Margin="0,0,4,0"
98                        Orientation="Horizontal"
99                        Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Provider.Count, Converter={StaticResource collapseIfSingleOverloadConverter}}">
100              <Button Name="PART_UP" Style="{StaticResource upDownButtonStyle}">
101                <Path Stroke="Black" Fill="Black" Data="M 0,0.866 L 1,0.866 L 0.5,0 Z" Stretch="UniformToFill" />
102              </Button>
103              <TextBlock Margin="2,0,2,0"
104                         Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Provider.CurrentIndexText}"/>
105              <Button Name="PART_DOWN" Style="{StaticResource upDownButtonStyle}">
106                <Path Stroke="Black" Fill="Black" Data="M 0,0 L 1,0 L 0.5,0.866 Z" Stretch="UniformToFill" />
107              </Button>
108            </StackPanel>
109            <ContentPresenter Grid.Row="0" Grid.Column="1" ContentTemplateSelector="{StaticResource templateSelector}"
110                              Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Provider.CurrentHeader}" />
111            <ContentPresenter Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" ContentTemplateSelector="{StaticResource templateSelector}"
112                              Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Provider.CurrentContent}" />
113          </Grid>
114        </ControlTemplate>
115      </Setter.Value>
116    </Setter>
117  </Style>
118</ResourceDictionary>
Note: See TracBrowser for help on using the repository browser.