|
20 | 20 | <Setter Property="FontFamily" Value="{DynamicResource VsFont.EnvironmentFontFamily}" /> |
21 | 21 | <Setter Property="FontSize" Value="{DynamicResource VsFont.EnvironmentFontSize}" /> |
22 | 22 | </Style> |
| 23 | + <Style x:Key="ColumnHeaderGripperStyle" TargetType="{x:Type Thumb}"> |
| 24 | + <Setter Property="Width" Value="8"/> |
| 25 | + <Setter Property="Background" Value="Transparent"/> |
| 26 | + <Setter Property="Cursor" Value="SizeWE"/> |
| 27 | + <Setter Property="Template"> |
| 28 | + <Setter.Value> |
| 29 | + <ControlTemplate TargetType="{x:Type Thumb}"> |
| 30 | + <Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}"/> |
| 31 | + </ControlTemplate> |
| 32 | + </Setter.Value> |
| 33 | + </Setter> |
| 34 | + </Style> |
23 | 35 | <Style TargetType="DataGridColumnHeader"> |
24 | 36 | <Setter Property="Foreground" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.GridHeadingTextBrushKey}}"/> |
25 | 37 | <Setter Property="Background" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.GridHeadingBackgroundBrushKey}}"/> |
26 | 38 | <Setter Property="SeparatorBrush" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.GridLineBrushKey}}"/> |
27 | 39 | <Setter Property="Padding" Value="4 0 0 0"/> |
| 40 | + <Setter Property="Template"> |
| 41 | + <Setter.Value> |
| 42 | + <ControlTemplate TargetType="{x:Type DataGridColumnHeader}"> |
| 43 | + <Grid> |
| 44 | + <Border x:Name="columnHeaderBorder" |
| 45 | + BorderThickness="1" |
| 46 | + Padding="3,0,3,0"> |
| 47 | + <Border.BorderBrush> |
| 48 | + <LinearGradientBrush EndPoint="0.5,1" |
| 49 | + StartPoint="0.5,0"> |
| 50 | + <GradientStop Color="{DynamicResource BorderLightColor}" |
| 51 | + Offset="0" /> |
| 52 | + <GradientStop Color="{DynamicResource BorderDarkColor}" |
| 53 | + Offset="1" /> |
| 54 | + </LinearGradientBrush> |
| 55 | + </Border.BorderBrush> |
| 56 | + <Border.Background> |
| 57 | + <LinearGradientBrush EndPoint="0.5,1" |
| 58 | + StartPoint="0.5,0"> |
| 59 | + <GradientStop Color="{DynamicResource ControlLightColor}" |
| 60 | + Offset="0" /> |
| 61 | + <GradientStop Color="{DynamicResource ControlMediumColor}" |
| 62 | + Offset="1" /> |
| 63 | + </LinearGradientBrush> |
| 64 | + </Border.Background> |
| 65 | + <Grid> |
| 66 | + <Grid.ColumnDefinitions> |
| 67 | + <ColumnDefinition Width="Auto"/> |
| 68 | + <ColumnDefinition Width="*"/> |
| 69 | + </Grid.ColumnDefinitions> |
| 70 | + <ContentPresenter Grid.Column="0" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> |
| 71 | + <Path x:Name="SortArrow" |
| 72 | + Grid.Column="1" |
| 73 | + HorizontalAlignment="Right" VerticalAlignment="Center" |
| 74 | + Width="8" Height="6" Margin="2,0,5,0" |
| 75 | + Stretch="Fill" Opacity="0.5" Fill="White" |
| 76 | + RenderTransformOrigin="0.5,0.4" |
| 77 | + Visibility="Collapsed" |
| 78 | + Data="M0,0 L1,0 0.5,1 z" /> |
| 79 | + </Grid> |
| 80 | + </Border> |
| 81 | + |
| 82 | + <Thumb x:Name="PART_LeftHeaderGripper" |
| 83 | + HorizontalAlignment="Left" |
| 84 | + Style="{StaticResource ColumnHeaderGripperStyle}"/> |
| 85 | + <Thumb x:Name="PART_RightHeaderGripper" |
| 86 | + HorizontalAlignment="Right" |
| 87 | + Style="{StaticResource ColumnHeaderGripperStyle}"/> |
| 88 | + </Grid> |
| 89 | + <ControlTemplate.Triggers> |
| 90 | + <Trigger Property="SortDirection" Value="Ascending"> |
| 91 | + <Setter TargetName="SortArrow" Property="Visibility" Value="Visible" /> |
| 92 | + <Setter TargetName="SortArrow" Property="RenderTransform"> |
| 93 | + <Setter.Value> |
| 94 | + <RotateTransform Angle="180" /> |
| 95 | + </Setter.Value> |
| 96 | + </Setter> |
| 97 | + </Trigger> |
| 98 | + <Trigger Property="SortDirection" Value="Descending"> |
| 99 | + <Setter TargetName="SortArrow" Property="Visibility" Value="Visible" /> |
| 100 | + </Trigger> |
| 101 | + </ControlTemplate.Triggers> |
| 102 | + </ControlTemplate> |
| 103 | + </Setter.Value> |
| 104 | + </Setter> |
28 | 105 | </Style> |
29 | 106 | <Style TargetType="DataGridCell"> |
30 | 107 | <Setter Property="Foreground" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.ToolWindowTextBrushKey}}"/> |
31 | 108 | <Setter Property="Background" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.ToolWindowBackgroundBrushKey}}"/> |
32 | | - <Setter Property="BorderBrush" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.GridLineBrushKey}}"/> |
33 | 109 | <Style.Triggers> |
34 | 110 | <Trigger Property="IsSelected" Value="true"> |
35 | 111 | <Setter Property="Foreground" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.SystemHighlightTextBrushKey}}"/> |
|
129 | 205 | <RowDefinition Height="Auto"/> |
130 | 206 | <RowDefinition Height="Auto"/> |
131 | 207 | </Grid.RowDefinitions> |
132 | | - <DataGrid Name="lstFiles" SelectionMode="Extended" MouseDoubleClick="lstFiles_MouseDoubleClick" PreviewKeyDown="lstFiles_PreviewKeyDown" AutoGenerateColumns="False" CanUserResizeRows="False" CanUserDeleteRows="False"> |
| 208 | + <DataGrid Name="lstFiles" SelectionMode="Extended" MouseDoubleClick="lstFiles_MouseDoubleClick" PreviewKeyDown="lstFiles_PreviewKeyDown" AutoGenerateColumns="False" CanUserResizeRows="False" CanUserDeleteRows="False" CanUserSortColumns="True"> |
133 | 209 | <DataGrid.Columns> |
134 | | - <DataGridTemplateColumn Header="Name" Width="SizeToCells"> |
| 210 | + <DataGridTemplateColumn Header="Name" Width="Auto" SortMemberPath="Filename"> |
135 | 211 | <DataGridTemplateColumn.CellTemplate> |
136 | 212 | <DataTemplate> |
137 | | - <TextBlock Text="{Binding Filename}"/> |
| 213 | + <TextBlock Text="{Binding Filename}" Padding="0,0,5,0"/> |
138 | 214 | </DataTemplate> |
139 | 215 | </DataGridTemplateColumn.CellTemplate> |
140 | 216 | </DataGridTemplateColumn> |
141 | | - <DataGridTemplateColumn Header="Project" Width="Auto"> |
| 217 | + <DataGridTemplateColumn Header="Project" Width="Auto" SortMemberPath="Project"> |
142 | 218 | <DataGridTemplateColumn.CellTemplate> |
143 | 219 | <DataTemplate> |
144 | | - <TextBlock Text="{Binding Project}"/> |
| 220 | + <TextBlock Text="{Binding Project}" Padding="0,0,5,0"/> |
145 | 221 | </DataTemplate> |
146 | 222 | </DataGridTemplateColumn.CellTemplate> |
147 | 223 | </DataGridTemplateColumn> |
148 | | - <DataGridTemplateColumn Header="Path" Width="Auto"> |
| 224 | + <DataGridTemplateColumn Header="Path" Width="*" SortMemberPath="Path"> |
149 | 225 | <DataGridTemplateColumn.CellTemplate> |
150 | 226 | <DataTemplate> |
151 | | - <TextBlock Text="{Binding Path}"/> |
| 227 | + <TextBlock Text="{Binding Path}" Padding="0,0,5,0"/> |
152 | 228 | </DataTemplate> |
153 | 229 | </DataGridTemplateColumn.CellTemplate> |
154 | 230 | </DataGridTemplateColumn> |
|
0 commit comments