Free cookie consent management tool by TermsFeed Policy Generator

source: branches/RemoveBackwardsCompatibility/HeuristicLab.ExtLibs/HeuristicLab.AvalonEdit/5.0.1/AvalonEdit-5.0.1/CodeCompletion/CompletionList.xaml @ 14113

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

#2077: created branch and added first version

File size: 2.2 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:AvalonEdit="clr-namespace:ICSharpCode.AvalonEdit"
4  xmlns:cc="clr-namespace:ICSharpCode.AvalonEdit.CodeCompletion"
5>
6  <Style TargetType="{x:Type ListBoxItem}" x:Key="CompletionListBoxItem">
7    <Setter Property="Template">
8      <Setter.Value>
9        <ControlTemplate TargetType="{x:Type ListBoxItem}">
10          <Border Name="Bd"
11                  Background="{TemplateBinding Background}"
12                  BorderBrush="{TemplateBinding BorderBrush}"
13                  BorderThickness="{TemplateBinding BorderThickness}"
14                  Padding="{TemplateBinding Padding}"
15                  SnapsToDevicePixels="true">
16            <ContentPresenter
17              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
18              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
19              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
20          </Border>
21          <!-- Simplified triggers:
22            we don't want a gray selection background when the ListBox doesn't have focus
23          -->
24          <ControlTemplate.Triggers>
25            <Trigger Property="IsSelected" Value="true">
26              <Setter Property="Background"
27                      Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
28              <Setter Property="Foreground"
29                      Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
30            </Trigger>
31          </ControlTemplate.Triggers>
32        </ControlTemplate>
33      </Setter.Value>
34    </Setter>
35  </Style>
36 
37  <Style TargetType="{x:Type cc:CompletionList}">
38    <Setter Property="Template">
39      <Setter.Value>
40        <ControlTemplate TargetType="{x:Type cc:CompletionList}">
41          <cc:CompletionListBox x:Name="PART_ListBox"
42            ItemContainerStyle="{StaticResource CompletionListBoxItem}">
43            <ItemsControl.ItemTemplate>
44              <DataTemplate>
45                <StackPanel Orientation="Horizontal">
46                  <Image Source="{Binding Image}" Width="16" Height="16" Margin="0,0,2,0"/>
47                  <ContentPresenter Content="{Binding Content}"/>
48                </StackPanel>
49              </DataTemplate>
50            </ItemsControl.ItemTemplate>
51          </cc:CompletionListBox>
52        </ControlTemplate>
53      </Setter.Value>
54    </Setter>
55  </Style>
56</ResourceDictionary>
Note: See TracBrowser for help on using the repository browser.