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