|
11 | 11 | <UserControl.Resources>
|
12 | 12 | <converters:InvertBoolValueConverter x:Key="InvertedBool" />
|
13 | 13 | <removeParameters:ParameterTextDecorationConverter x:Key="ParameterTextDecoration" />
|
| 14 | + |
| 15 | + <Style x:Key="FocusVisual"> |
| 16 | + <Setter Property="Control.Template"> |
| 17 | + <Setter.Value> |
| 18 | + <ControlTemplate> |
| 19 | + <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/> |
| 20 | + </ControlTemplate> |
| 21 | + </Setter.Value> |
| 22 | + </Setter> |
| 23 | + </Style> |
| 24 | + <SolidColorBrush x:Key="Item.MouseOver.Background" Color="#1F26A0DA"/> |
| 25 | + <SolidColorBrush x:Key="Item.MouseOver.Border" Color="#a826A0Da"/> |
| 26 | + <LinearGradientBrush x:Key="Item.SelectedInactive.Background" EndPoint="0,1" StartPoint="0,0"> |
| 27 | + <GradientStop Color="#FFEEEDED" Offset="0"/> |
| 28 | + <GradientStop Color="#FFDDDDDD" Offset="1"/> |
| 29 | + </LinearGradientBrush> |
| 30 | + <SolidColorBrush x:Key="Item.SelectedInactive.Border" Color="LightGray"/> |
| 31 | + <LinearGradientBrush x:Key="Item.SelectedActive.Background" EndPoint="0,1" StartPoint="0,0"> |
| 32 | + <GradientStop Color="#FFD9F4FF" Offset="0"/> |
| 33 | + <GradientStop Color="#FF9BDDFB" Offset="1"/> |
| 34 | + </LinearGradientBrush> |
| 35 | + <SolidColorBrush x:Key="Item.SelectedActive.Border" Color="#ADC6E5"/> |
| 36 | + <Style x:Key="PrettyListBoxItem" TargetType="{x:Type ListBoxItem}"> |
| 37 | + <Style.Resources> |
| 38 | + <Style TargetType="{x:Type Border}"> |
| 39 | + <Setter Property="CornerRadius" Value="2"/> |
| 40 | + </Style> |
| 41 | + </Style.Resources> |
| 42 | + <Setter Property="SnapsToDevicePixels" Value="True"/> |
| 43 | + <Setter Property="Padding" Value="4,1"/> |
| 44 | + <Setter Property="HorizontalContentAlignment" Value="Left"/> |
| 45 | + <Setter Property="VerticalContentAlignment" Value="Center"/> |
| 46 | + <Setter Property="Background" Value="Transparent"/> |
| 47 | + <Setter Property="BorderBrush" Value="Black"/> |
| 48 | + <Setter Property="BorderThickness" Value="0,.5,0,0"/> |
| 49 | + <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/> |
| 50 | + <Setter Property="Height" Value="26" /> |
| 51 | + <EventSetter Event="MouseDoubleClick" Handler="ListBoxItem_MouseDoubleClick" /> |
| 52 | + <Setter Property="Template"> |
| 53 | + <Setter.Value> |
| 54 | + <ControlTemplate TargetType="{x:Type ListBoxItem}"> |
| 55 | + <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true"> |
| 56 | + <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> |
| 57 | + </Border> |
| 58 | + <ControlTemplate.Triggers> |
| 59 | + <MultiTrigger> |
| 60 | + <MultiTrigger.Conditions> |
| 61 | + <Condition Property="IsMouseOver" Value="True"/> |
| 62 | + </MultiTrigger.Conditions> |
| 63 | + <Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.MouseOver.Background}"/> |
| 64 | + <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.MouseOver.Border}"/> |
| 65 | + </MultiTrigger> |
| 66 | + <MultiTrigger> |
| 67 | + <MultiTrigger.Conditions> |
| 68 | + <Condition Property="Selector.IsSelectionActive" Value="False"/> |
| 69 | + <Condition Property="IsSelected" Value="True"/> |
| 70 | + </MultiTrigger.Conditions> |
| 71 | + <Setter Property="BorderThickness" Value="1.5" /> |
| 72 | + <Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Background}"/> |
| 73 | + <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Border}"/> |
| 74 | + </MultiTrigger> |
| 75 | + <MultiTrigger> |
| 76 | + <MultiTrigger.Conditions> |
| 77 | + <Condition Property="Selector.IsSelectionActive" Value="True"/> |
| 78 | + <Condition Property="IsSelected" Value="True"/> |
| 79 | + </MultiTrigger.Conditions> |
| 80 | + <Setter Property="BorderThickness" Value="1.5" /> |
| 81 | + <Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Background}"/> |
| 82 | + <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Border}"/> |
| 83 | + </MultiTrigger> |
| 84 | + <Trigger Property="IsEnabled" Value="False"> |
| 85 | + <Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> |
| 86 | + </Trigger> |
| 87 | + </ControlTemplate.Triggers> |
| 88 | + </ControlTemplate> |
| 89 | + </Setter.Value> |
| 90 | + </Setter> |
| 91 | + </Style> |
14 | 92 | </UserControl.Resources>
|
15 | 93 | <Grid>
|
16 | 94 | <Grid.RowDefinitions>
|
|
32 | 110 | <ColumnDefinition Width="*" />
|
33 | 111 | <ColumnDefinition Width="auto" />
|
34 | 112 | </Grid.ColumnDefinitions>
|
35 |
| - <ListView Margin="5,5,0,5" |
36 |
| - ItemsSource="{Binding Parameters, UpdateSourceTrigger=PropertyChanged}" |
37 |
| - SelectedIndex="0" |
38 |
| - Name="ParameterGrid" |
39 |
| - AlternationCount="2"> |
40 |
| - <ListView.ItemTemplate> |
| 113 | + <ListBox Margin="5,5,0,5" |
| 114 | + ItemsSource="{Binding Parameters, UpdateSourceTrigger=PropertyChanged}" |
| 115 | + SelectedIndex="0" |
| 116 | + Name="ParameterGrid" |
| 117 | + ItemContainerStyle="{StaticResource PrettyListBoxItem}" |
| 118 | + AlternationCount="2"> |
| 119 | + <ListBox.ItemTemplate> |
41 | 120 | <DataTemplate>
|
42 | 121 | <TextBlock Text="{Binding Name}"
|
43 | 122 | TextDecorations="{Binding IsRemoved, Converter={StaticResource ParameterTextDecoration}}" />
|
44 | 123 | </DataTemplate>
|
45 |
| - </ListView.ItemTemplate> |
46 |
| - <ListView.ItemContainerStyle> |
47 |
| - <Style TargetType="ListViewItem"> |
48 |
| - <Style.Triggers> |
49 |
| - <Trigger Property="ItemsControl.AlternationIndex" Value="0"> |
50 |
| - <Setter Property="Background" Value="White" /> |
51 |
| - </Trigger> |
52 |
| - <Trigger Property="ItemsControl.AlternationIndex" Value="1"> |
53 |
| - <Setter Property="Background" Value="Lavender" /> |
54 |
| - </Trigger> |
55 |
| - </Style.Triggers> |
56 |
| - <EventSetter Event="MouseDoubleClick" Handler="ListViewItem_MouseDoubleClick" /> |
57 |
| - </Style> |
58 |
| - </ListView.ItemContainerStyle> |
59 |
| - </ListView> |
| 124 | + </ListBox.ItemTemplate> |
| 125 | + </ListBox> |
60 | 126 |
|
61 | 127 | <Grid HorizontalAlignment="Right"
|
62 | 128 | Grid.Column="1">
|
|
0 commit comments